Click here to Skip to main content
15,892,537 members
Home / Discussions / C#
   

C#

 
AnswerRe: a simple doubt Pin
sam#5-Nov-06 20:10
sam#5-Nov-06 20:10 
Questionmedia player Pin
Nafiseh Salmani5-Nov-06 19:59
Nafiseh Salmani5-Nov-06 19:59 
AnswerRe: media player Pin
Nafiseh Salmani5-Nov-06 20:07
Nafiseh Salmani5-Nov-06 20:07 
GeneralHelpfull Installers Pin
JacquesDP5-Nov-06 19:53
JacquesDP5-Nov-06 19:53 
Generalconsole application Pin
Ravi Shankar435-Nov-06 19:08
Ravi Shankar435-Nov-06 19:08 
GeneralRe: console application Pin
Christian Graus5-Nov-06 19:13
protectorChristian Graus5-Nov-06 19:13 
Questiondatagrid Pin
Ravi Shankar435-Nov-06 19:05
Ravi Shankar435-Nov-06 19:05 
AnswerRe: datagrid Pin
Christian Graus5-Nov-06 19:14
protectorChristian Graus5-Nov-06 19:14 
GeneralRe: datagrid Pin
coolestCoder5-Nov-06 19:28
coolestCoder5-Nov-06 19:28 
GeneralRe: datagrid Pin
Ravi Shankar435-Nov-06 19:37
Ravi Shankar435-Nov-06 19:37 
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 

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.