Click here to Skip to main content
15,889,649 members
Home / Discussions / C#
   

C#

 
GeneralRe: Ok, now it's my turn to complain about C# Pin
PIEBALDconsult24-Nov-10 9:23
mvePIEBALDconsult24-Nov-10 9:23 
GeneralRe: Ok, now it's my turn to complain about C# Pin
Luc Pattyn24-Nov-10 9:31
sitebuilderLuc Pattyn24-Nov-10 9:31 
AnswerRe: Ok, now it's my turn to complain about C# Pin
_Erik_23-Nov-10 4:44
_Erik_23-Nov-10 4:44 
GeneralRe: Ok, now it's my turn to complain about C# Pin
Ray Cassick24-Nov-10 10:41
Ray Cassick24-Nov-10 10:41 
AnswerRe: Ok, now it's my turn to complain about C# Pin
PIEBALDconsult24-Nov-10 9:37
mvePIEBALDconsult24-Nov-10 9:37 
GeneralRe: Ok, now it's my turn to complain about C# Pin
Ray Cassick24-Nov-10 10:38
Ray Cassick24-Nov-10 10:38 
QuestionHow do you initialize automatic list properties? Pin
T M Gray22-Nov-10 9:10
T M Gray22-Nov-10 9:10 
AnswerRe: How do you initialize automatic list properties? Pin
Not Active22-Nov-10 9:19
mentorNot Active22-Nov-10 9:19 
Either use a backing field and lazy initialization

public class Thing
{
  private List<Foo> m_List;
  
  Thing() { }
  
  public List<Foo> MyFoos
  {
     get
     { 
       if(m_List == null)
          m_List = new List<Foo>();

       return m_List;
     }
     set{ m_List = value; }
}


or use the constructor

public class Thing
{
   Thing()
   {
     MyFoos = new List<Foo>();
   }

   public List<Foo> MyFoos {get; set;}
}


I know the language. I've read a book. - _Madmatt

GeneralRe: How do you initialize automatic list properties? Pin
fjdiewornncalwe22-Nov-10 9:33
professionalfjdiewornncalwe22-Nov-10 9:33 
GeneralRe: How do you initialize automatic list properties? Pin
T M Gray22-Nov-10 9:44
T M Gray22-Nov-10 9:44 
GeneralRe: How do you initialize automatic list properties? Pin
fjdiewornncalwe22-Nov-10 9:55
professionalfjdiewornncalwe22-Nov-10 9:55 
GeneralRe: How do you initialize automatic list properties? Pin
T M Gray22-Nov-10 10:20
T M Gray22-Nov-10 10:20 
GeneralRe: How do you initialize automatic list properties? Pin
Pete O'Hanlon22-Nov-10 10:28
mvePete O'Hanlon22-Nov-10 10:28 
GeneralRe: How do you initialize automatic list properties? Pin
Pete O'Hanlon22-Nov-10 10:29
mvePete O'Hanlon22-Nov-10 10:29 
AnswerRe: How do you initialize automatic list properties? Pin
Eddy Vluggen22-Nov-10 9:19
professionalEddy Vluggen22-Nov-10 9:19 
Questionbest FREE Wizard control Pin
Jassim Rahma22-Nov-10 3:24
Jassim Rahma22-Nov-10 3:24 
AnswerRe: best FREE Wizard control Pin
DaveyM6922-Nov-10 7:25
professionalDaveyM6922-Nov-10 7:25 
GeneralRe: best FREE Wizard control Pin
Jassim Rahma23-Nov-10 3:22
Jassim Rahma23-Nov-10 3:22 
QuestionAdvertisment Impressions Pin
Jassim Rahma22-Nov-10 3:11
Jassim Rahma22-Nov-10 3:11 
QuestionPop up window (like skype) Pin
Anil Kumar.Arvapalli22-Nov-10 1:25
Anil Kumar.Arvapalli22-Nov-10 1:25 
AnswerRe: Pop up window (like skype) Pin
JF201522-Nov-10 1:30
JF201522-Nov-10 1:30 
AnswerRe: Pop up window (like skype) Pin
Manfred Rudolf Bihy22-Nov-10 2:20
professionalManfred Rudolf Bihy22-Nov-10 2:20 
Questionhow to use .m file in C# Pin
Darko Nikolovski21-Nov-10 22:54
Darko Nikolovski21-Nov-10 22:54 
AnswerRe: how to use .m file in C# Pin
Niladri_Biswas22-Nov-10 2:53
Niladri_Biswas22-Nov-10 2:53 
QuestionImage minus image Pin
pancakeleh21-Nov-10 14:59
pancakeleh21-Nov-10 14:59 

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.