29.21 Its possible that some of my class members will not be initialized when one of my virtual members gets called even before the constructor. How can I avoid this?


If possible, initialize them in-line:

     public class MyClass
     {
          public ArrayList myArrayList = new ArrayList();

          public MyClass(){}
     
          public override void MyOverride()
          {
               // When this gets called by the base class constructor, myArrayList will be initialized.
          }
     
     }

© 2001-2010 Copyright Syncfusion Inc. All rights reserved.  |  Privacy Policy  |  Contact  |  Sitemap