[Gtk-sharp-list] assembly initialization

Mike Kestner mkestner@ximian.com
Wed, 19 May 2004 20:53:09 -0500


On Wed, 2004-05-19 at 18:34, Vladimir Vukicevic wrote:

> internal class GtkHtmlSharpInitializer {
> 	static GtkHtmlSharpInitializer() {
> 		/* register GTypes, etc. */
> 	}
> }
> 
> This is essentially what the "assembly initializer" would be doing 
> anyway; that static constructor will get called when the assembly is 
> first loaded.

My understanding is that cctors are only guaranteed to be run before any
member code of the class is executed, which in your example would be
never, since no user would ever access that class.

-- 
Mike Kestner <mkestner@ximian.com>