We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
__ExceptionInfo
-
Expand
__ExceptionInstance
-
Expand
__FixupData
-
Expand
AssemblyBuilder
-
Expand
AssemblyBuilderAccess
-
Expand
AssemblyBuilderData
-
Expand
ConstructorBuilder
-
Expand
ConstructorOnTypeBuilderInstantiation
-
Expand
CustAttr
-
Expand
CustomAttributeBuilder
-
Expand
DestroyScout
-
Expand
DynamicILGenerator
-
Expand
DynamicILInfo
-
Expand
DynamicMethod
-
Expand
DynamicResolver
-
Expand
DynamicScope
-
Expand
EmptyCAHolder
-
Expand
Entry
-
Expand
EnumBuilder
-
Expand
EventBuilder
-
Expand
EventToken
-
Expand
FieldBuilder
-
Attributes()
-
DeclaringType()
-
FieldBuilder(TypeBuilder, string, Type, Type, Type, FieldAttributes)
-
FieldHandle()
-
FieldType()
-
GetCustomAttributes(bool)
-
GetCustomAttributes(Type, bool)
-
GetIDsOfNames(Guid, IntPtr, uint, uint, IntPtr)
-
GetToken()
-
GetTypeBuilder()
-
GetTypeInfo(uint, uint, IntPtr)
-
GetTypeInfoCount(uint)
-
GetValue(object)
-
Invoke(uint, Guid, uint, short, IntPtr, IntPtr, IntPtr, IntPtr)
-
IsDefined(Type, bool)
-
MetadataTokenInternal()
-
Module()
-
Name()
-
ReflectedType()
-
SetConstant(object)
-
SetCustomAttribute(ConstructorInfo, byte)
-
SetCustomAttribute(CustomAttributeBuilder)
-
SetData(byte, int)
-
SetMarshal(UnmanagedMarshal)
-
SetOffset(int)
-
SetValue(object, object, BindingFlags, Binder, CultureInfo)
-
Expand
FieldOnTypeBuilderInstantiation
-
Expand
FieldToken
-
Expand
FlowControl
-
Expand
Format
-
Expand
GenericMethodInfo
-
Expand
GenericTypeParameterBuilder
-
Expand
ILGenerator
-
Expand
Label
-
Expand
LineNumberInfo
-
Expand
LocalBuilder
-
Expand
LocalSymInfo
-
Expand
MethodBuilder
-
Expand
MethodBuilderInstantiation
-
Expand
MethodOnTypeBuilderInstantiation
-
Expand
MethodRental
-
Expand
MethodToken
-
Expand
ModuleBuilder
-
Expand
ModuleBuilderData
-
Expand
OpCode
-
Expand
OpCodes
-
Expand
OpCodeType
-
Expand
OperandType
-
Expand
PackingSize
-
Expand
ParameterBuilder
-
Expand
ParameterToken
-
Expand
PEFileKinds
-
Expand
PropertyBuilder
-
Expand
PropertyToken
-
Expand
REDocument
-
Expand
ResWriterData
-
Expand
RTDynamicMethod
-
Expand
ScopeAction
-
Expand
ScopeTree
-
Expand
SecurityControlFlags
-
Expand
SignatureHelper
-
Expand
SignatureToken
-
Expand
StackBehaviour
-
Expand
StringToken
-
Expand
SymbolMethod
-
Expand
SymbolType
-
Expand
SymCustomAttr
-
Expand
TypeBuilder
-
Expand
TypeBuilderInstantiation
-
Expand
TypeKind
-
Expand
TypeNameBuilder
-
Expand
TypeToken
-
Expand
UnmanagedMarshal
-
Expand
VarArgMethod
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- namespace System.Reflection.Emit
- {
- using System.Runtime.InteropServices;
- using System;
- using CultureInfo = System.Globalization.CultureInfo;
- using System.Reflection;
- using System.Security.Permissions;
-
- [HostProtection(MayLeakOnAbort = true)]
- [ClassInterface(ClassInterfaceType.None)]
- [ComDefaultInterface(typeof(_FieldBuilder))]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class FieldBuilder : FieldInfo, _FieldBuilder
- {
- #region Private Data Members
- private int m_fieldTok;
- private FieldToken m_tkField;
- private TypeBuilder m_typeBuilder;
- private string m_fieldName;
- private FieldAttributes m_Attributes;
- private Type m_fieldType;
- internal byte[] m_data;
- #endregion
-
- #region Constructor
- internal FieldBuilder(TypeBuilder typeBuilder, string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
- {
- if (fieldName == null)
- throw new ArgumentNullException("fieldName");
-
- if (fieldName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "fieldName");
-
- if (fieldName[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), "fieldName");
-
- if (type == null)
- throw new ArgumentNullException("type");
-
- if (type == typeof(void))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
-
- m_fieldName = fieldName;
- m_typeBuilder = typeBuilder;
- m_fieldType = type;
- m_Attributes = attributes & ~FieldAttributes.ReservedMask;
-
- SignatureHelper sigHelp = SignatureHelper.GetFieldSigHelper(m_typeBuilder.Module);
- sigHelp.AddArgument(type, requiredCustomModifiers, optionalCustomModifiers);
-
- int sigLength;
- byte[] signature = sigHelp.InternalGetSignature(out sigLength);
-
- m_fieldTok = TypeBuilder.InternalDefineField(typeBuilder.TypeToken.Token, fieldName, signature, sigLength, m_Attributes, m_typeBuilder.Module);
-
- m_tkField = new FieldToken(m_fieldTok, type);
- }
-
- #endregion
-
- #region Internal Members
- internal void SetData(byte[] data, int size)
- {
- if (data != null) {
- m_data = new byte[data.Length];
- Array.Copy(data, m_data, data.Length);
- }
-
- m_typeBuilder.Module.InternalSetFieldRVAContent(m_tkField.Token, data, size);
- }
-
- internal TypeBuilder GetTypeBuilder()
- {
- return m_typeBuilder;
- }
- #endregion
-
- #region MemberInfo Overrides
- internal override int MetadataTokenInternal {
- get { return m_fieldTok; }
- }
-
- public override Module Module {
- get { return m_typeBuilder.Module; }
- }
-
- public override string Name {
- get { return m_fieldName; }
- }
-
- public override Type DeclaringType {
- get {
- if (m_typeBuilder.m_isHiddenGlobalType == true)
- return null;
-
- return m_typeBuilder;
- }
- }
-
- public override Type ReflectedType {
- get {
- if (m_typeBuilder.m_isHiddenGlobalType == true)
- return null;
-
- return m_typeBuilder;
- }
- }
-
- #endregion
-
- #region FieldInfo Overrides
- public override Type FieldType {
- get { return m_fieldType; }
- }
-
- public override object GetValue(object obj)
- {
-
-
-
-
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
-
- public override void SetValue(object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
- {
-
-
-
-
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
-
- public override RuntimeFieldHandle FieldHandle {
- get {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
- }
-
- public override FieldAttributes Attributes {
- get { return m_Attributes; }
- }
-
- #endregion
-
- #region ICustomAttributeProvider Implementation
- public override object[] GetCustomAttributes(bool inherit)
- {
-
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
-
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
- {
-
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
-
- public override bool IsDefined(Type attributeType, bool inherit)
- {
-
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
- }
-
- #endregion
-
- #region Public Members
- public FieldToken GetToken()
- {
- return m_tkField;
- }
-
- public void SetOffset(int iOffset)
- {
- m_typeBuilder.ThrowIfCreated();
-
- TypeBuilder.InternalSetFieldOffset(m_typeBuilder.Module, GetToken().Token, iOffset);
- }
-
- [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- public void SetMarshal(UnmanagedMarshal unmanagedMarshal)
- {
- m_typeBuilder.ThrowIfCreated();
-
- if (unmanagedMarshal == null)
- throw new ArgumentNullException("unmanagedMarshal");
-
- byte[] ubMarshal = unmanagedMarshal.InternalGetBytes();
-
- TypeBuilder.InternalSetMarshalInfo(m_typeBuilder.Module, GetToken().Token, ubMarshal, ubMarshal.Length);
- }
-
- public void SetConstant(object defaultValue)
- {
- m_typeBuilder.ThrowIfCreated();
-
- TypeBuilder.SetConstantValue(m_typeBuilder.Module, GetToken().Token, m_fieldType, defaultValue);
- }
-
- [System.Runtime.InteropServices.ComVisible(true)]
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
- {
- ModuleBuilder module = m_typeBuilder.Module as ModuleBuilder;
-
- m_typeBuilder.ThrowIfCreated();
-
- if (con == null)
- throw new ArgumentNullException("con");
-
- if (binaryAttribute == null)
- throw new ArgumentNullException("binaryAttribute");
-
- TypeBuilder.InternalCreateCustomAttribute(m_tkField.Token, module.GetConstructorToken(con).Token, binaryAttribute, module, false);
- }
-
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
- {
- m_typeBuilder.ThrowIfCreated();
-
- if (customBuilder == null)
- throw new ArgumentNullException("customBuilder");
-
- ModuleBuilder module = m_typeBuilder.Module as ModuleBuilder;
-
- customBuilder.CreateCustomAttribute(module, m_tkField.Token);
- }
-
- #endregion
-
- void _FieldBuilder.GetTypeInfoCount(out uint pcTInfo)
- {
- throw new NotImplementedException();
- }
-
- void _FieldBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
- {
- throw new NotImplementedException();
- }
-
- void _FieldBuilder.GetIDsOfNames( [In()]
- ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
- {
- throw new NotImplementedException();
- }
-
- void _FieldBuilder.Invoke(uint dispIdMember, [In()]
- ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
- {
- throw new NotImplementedException();
- }
- }
- }