Click here for information on how to use code snippets in VS.NET (2005+)
Object: ID: ClassType: System.ObjectToolTip: A class or struct.Default: Test
ID: ClassType: System.ObjectToolTip: A class or struct.Default: Test
// NOTE: This code snippet is designed for VS.NET 2005 or later. // Note that the rules for static constructors also applied to // structs. public class $Class$ { // Static constructor: // Static constructors will get called before any instance constructors. // There can be only one static constructor; no overloads are permitted. // Static constructors get called when either 1) the CLR creates an // instance of the class OR 2) the first static member of the class is // accessed. // Static constructors do not accept member visibility keywords (such // as public, private, protected, internal and protected internal). static $Class$() { MessageBox.Show("Static constructor"); } // Instance constructor: // Instance constructors get called after static constructors. public $Class$() { MessageBox.Show("Instance constructor"); } public static readonly String Hello = "Hello!"; }
XML View:
Declaring Static Constructors declstaticconstructors Declaring Static Constructors C# .Net Fun - http://www.dotnetfun.com - Michael G. Class System.Object A class or struct. Test