Mono.Cecil.Fluent.ModuleDefinitionExtensions.CreateType C# (CSharp) Method

CreateType() public static method

public static CreateType ( this that, string name = null, TypeAttributes attributes = null ) : TypeDefinition
that this
name string
attributes TypeAttributes
return TypeDefinition
		public static TypeDefinition CreateType(this ModuleDefinition that, string name = null, TypeAttributes? attributes = null)
		{
            // todo: create inherited type (enable specification of base class)

			if (string.IsNullOrEmpty(name))
				name = Generate.Name.ForClass();

			var type = new TypeDefinition("", name, attributes ?? TypeAttributes.Class);
			that.Types.Add(type);

			return type;
		}
	}
ModuleDefinitionExtensions