Click here to Skip to main content
15,886,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: datagrid Pin
sam#5-Nov-06 20:00
sam#5-Nov-06 20:00 
Questionerror for parent form serialport object... Pin
IamHuM5-Nov-06 19:02
IamHuM5-Nov-06 19:02 
AnswerRe: error for parent form serialport object... Pin
Tavbi6-Nov-06 0:25
Tavbi6-Nov-06 0:25 
QuestionE-mail Subject Problem Pin
Brendan Vogt5-Nov-06 18:59
Brendan Vogt5-Nov-06 18:59 
AnswerRe: E-mail Subject Problem Pin
Corinna John5-Nov-06 20:56
Corinna John5-Nov-06 20:56 
AnswerRe: E-mail Subject Problem Pin
playout8-Nov-06 2:41
playout8-Nov-06 2:41 
QuestionLogon to Windows 2003 server. Pin
mariarajakumar5-Nov-06 18:37
mariarajakumar5-Nov-06 18:37 
QuestionFunction to convert ArrayList to List and vice versa Pin
Rafferty Uy5-Nov-06 18:02
Rafferty Uy5-Nov-06 18:02 
Hello,

I am trying to create a static method that converts ArrayList to List<t> and vice versa. I am at a loss at how to do it, anyone care to help? I posted the code I created below.

<br />
    public static List<T> ConvertArrayListToList(ArrayList arrayList, Type T)<br />
    {<br />
      List<T> result = new List<T>();<br />
<br />
      for ( int i = 0; i < arrayList.Count; i++ )<br />
      {<br />
        if (arrayList[i] is T)<br />
          result.Add((T)arrayList[i]);<br />
      }<br />
<br />
      return result;<br />
    }<br />
    <br />
    public static ArrayList ConvertListToArrayList(List<T> list)<br />
    {<br />
      ArrayList result = new ArrayList();<br />
<br />
      for ( int i = 0; i < list.Count; i++ )<br />
      {<br />
        result.Add(list[i]);<br />
      }<br />
<br />
      return result;<br />
    }<br />


Thanks!

~Rafferty
AnswerRe: Function to convert ArrayList to List and vice versa Pin
Christian Graus5-Nov-06 19:16
protectorChristian Graus5-Nov-06 19:16 
QuestionZip a Folder Pin
Rahul.RK5-Nov-06 17:42
Rahul.RK5-Nov-06 17:42 
AnswerRe: Zip a Folder Pin
coolestCoder5-Nov-06 19:37
coolestCoder5-Nov-06 19:37 
AnswerRe: Zip a Folder Pin
Suelinda_W15-Dec-06 7:50
Suelinda_W15-Dec-06 7:50 
Questionproblem in adding text >64k in wmv file? Pin
Hemant kulkarni5-Nov-06 17:29
Hemant kulkarni5-Nov-06 17:29 
QuestionCan I lose the default XML namespace ? Pin
Bart7Simpson75-Nov-06 15:30
Bart7Simpson75-Nov-06 15:30 
QuestionIFilter RTF Full Text Indexing Pin
smarttom995-Nov-06 14:31
smarttom995-Nov-06 14:31 
Questionmaximize custom windows form Pin
Andreas885-Nov-06 12:34
Andreas885-Nov-06 12:34 
QuestionInserting string at a particular position in RichTextBox Pin
kclteam5-Nov-06 12:32
kclteam5-Nov-06 12:32 
AnswerRe: Inserting string at a particular position in RichTextBox Pin
Christian Graus5-Nov-06 13:49
protectorChristian Graus5-Nov-06 13:49 
AnswerRe: Inserting string at a particular position in RichTextBox Pin
sam#5-Nov-06 20:07
sam#5-Nov-06 20:07 
AnswerRe: Inserting string at a particular position in RichTextBox Pin
Coding C#6-Nov-06 2:50
Coding C#6-Nov-06 2:50 
GeneralRe: Inserting string at a particular position in RichTextBox Pin
kclteam6-Nov-06 5:29
kclteam6-Nov-06 5:29 
QuestionSystem info Pin
sj_h15-Nov-06 11:05
sj_h15-Nov-06 11:05 
AnswerRe: System info Pin
Guffa5-Nov-06 11:56
Guffa5-Nov-06 11:56 
GeneralRe: System info Pin
sj_h15-Nov-06 12:03
sj_h15-Nov-06 12:03 
AnswerRe: System info Pin
Guffa5-Nov-06 12:52
Guffa5-Nov-06 12:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.