NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Defining a Type

Types are defined in the scope of a dynamic module using the ModuleBuilder.DefineType methods. DefineType returns a TypeBuilder object. In what follows, the type name is always a full path name. The Reflection Emit APIs provide the following options for defining types:

Before a type is used, the TypeBuilder.CreateType method must be called. CreateType completes the creation of the type. Following the call to CreateType, the caller can instantiate the type (using Type.CreateInstance) and invoke members of the type (using Type.InvokeMember). It is an error to invoke methods that change the implementation of a type after CreateType has been called. For example, the runtime will throw an exception if the caller tries to add new members to a type.

A class initializer is created using the method TypeBuilder.DefineTypeInitializer. DefineTypeInitializer returns a ConstructorBuilder object.

Nested types are defined using one of TypeBuilder.DefineNestedType methods.

The TypeBuilder.AddDeclarativeSecurity method adds declarative security to a type being built. AddDeclarativeSecurity may be called several times with each call specifying a security action (e.g., Demand, Assert, Deny) and a set of permissions that the action applies to.

Attributes

Known Issues