static public FieldDefinition Field <T>(this TypeDefinition type, string name, FieldAttributes attributes) { var _field = new FieldDefinition(name, attributes, type.Module.Import(typeof(T))); type.Fields.Add(_field); _field.Attribute <CompilerGeneratedAttribute>(); _field.Attribute(() => new DebuggerBrowsableAttribute(DebuggerBrowsableState.Never)); return(_field); }
static public FieldDefinition Field(this TypeDefinition type, string name, FieldAttributes attributes, TypeReference @return) { var _field = new FieldDefinition(name, attributes, @return); type.Fields.Add(_field); _field.Attribute <CompilerGeneratedAttribute>(); _field.Attribute(() => new DebuggerBrowsableAttribute(DebuggerBrowsableState.Never)); return(_field); }