Click here to Skip to main content
15,880,427 members
Home / Discussions / C#
   

C#

 
AnswerRe: Deleting objects from a collection Pin
DaveyM6917-Oct-09 12:51
professionalDaveyM6917-Oct-09 12:51 
GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 12:55
mentorTrollslayer17-Oct-09 12:55 
GeneralRe: Deleting objects from a collection Pin
DaveyM6917-Oct-09 13:10
professionalDaveyM6917-Oct-09 13:10 
GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 13:16
mentorTrollslayer17-Oct-09 13:16 
GeneralRe: Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:33
sitebuilderLuc Pattyn17-Oct-09 13:33 
Answer[Added informatio] Deleting objects from a collection Pin
Trollslayer17-Oct-09 13:05
mentorTrollslayer17-Oct-09 13:05 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
DaveyM6917-Oct-09 13:17
professionalDaveyM6917-Oct-09 13:17 
GeneralRe: [Added informatio] Deleting objects from a collection [modified] Pin
CaptainSeeSharp17-Oct-09 13:20
CaptainSeeSharp17-Oct-09 13:20 
List list1;
list1 = new List;

list1.Add(new MyClass());
list1[0].num = 3;

list1[0] = null;      // this is not needed in this scenario since RemoveAt cuts off the reference from the object itself

list1.RemoveAt(0);    // This removes the reference but does it remove the object?

//System.GC.Collect(); //if you know when to use it "profitably".

public class MyClass : Object
{
    public int num;
    public string str;
}



modified on Saturday, October 17, 2009 7:32 PM

GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:36
sitebuilderLuc Pattyn17-Oct-09 13:36 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
CaptainSeeSharp17-Oct-09 13:43
CaptainSeeSharp17-Oct-09 13:43 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:53
sitebuilderLuc Pattyn17-Oct-09 13:53 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:47
sitebuilderLuc Pattyn17-Oct-09 13:47 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
harold aptroot17-Oct-09 14:09
harold aptroot17-Oct-09 14:09 
AnswerRe: Deleting objects from a collection Pin
dojohansen17-Oct-09 23:05
dojohansen17-Oct-09 23:05 
AnswerThanks everyone - results Pin
Trollslayer18-Oct-09 2:58
mentorTrollslayer18-Oct-09 2:58 
GeneralRe: Thanks everyone - results Pin
DaveyM6918-Oct-09 3:51
professionalDaveyM6918-Oct-09 3:51 
GeneralRe: Thanks everyone - results Pin
Trollslayer18-Oct-09 3:57
mentorTrollslayer18-Oct-09 3:57 
GeneralRe: Thanks everyone - results Pin
DaveyM6918-Oct-09 4:04
professionalDaveyM6918-Oct-09 4:04 
Questiongetting Bios date from c# in win64 environments Pin
Fred 3417-Oct-09 7:17
Fred 3417-Oct-09 7:17 
AnswerRe: getting Bios date from c# in win64 environments Pin
Abhijit Jana17-Oct-09 8:24
professionalAbhijit Jana17-Oct-09 8:24 
GeneralRe: getting Bios date from c# in win64 environments Pin
Fred 3417-Oct-09 9:09
Fred 3417-Oct-09 9:09 
GeneralRe: getting Bios date from c# in win64 environments Pin
Richard MacCutchan17-Oct-09 9:30
mveRichard MacCutchan17-Oct-09 9:30 
GeneralRe: getting Bios date from c# in win64 environments Pin
Abhijit Jana17-Oct-09 9:58
professionalAbhijit Jana17-Oct-09 9:58 
AnswerRe: getting Bios date from c# in win64 environments Pin
Vimalsoft(Pty) Ltd17-Oct-09 8:58
professionalVimalsoft(Pty) Ltd17-Oct-09 8:58 
AnswerRe: getting Bios date from c# in win64 environments Pin
dan!sh 17-Oct-09 9:49
professional dan!sh 17-Oct-09 9:49 

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.