System.Reflection.Emit.DynamicScope.GetTokenFor C# (CSharp) Method

GetTokenFor() public method

public GetTokenFor ( DynamicMethod method ) : int
method DynamicMethod
return int
        public int GetTokenFor(DynamicMethod method) { return m_tokens.Add(method) | (int)MetadataTokenType.MethodDef; }
        public int GetTokenFor(RuntimeFieldHandle field) { return m_tokens.Add(field) | (int)MetadataTokenType.FieldDef; }

Same methods

DynamicScope::GetTokenFor ( RuntimeFieldHandle field ) : int
DynamicScope::GetTokenFor ( RuntimeMethodHandle method ) : int
DynamicScope::GetTokenFor ( RuntimeMethodHandle method, RuntimeTypeHandle typeContext ) : int
DynamicScope::GetTokenFor ( RuntimeTypeHandle type ) : int
DynamicScope::GetTokenFor ( VarArgMethod varArgMethod ) : int
DynamicScope::GetTokenFor ( byte signature ) : int
DynamicScope::GetTokenFor ( string literal ) : int

Usage Example

Esempio n. 1
0
        internal unsafe DynamicILGenerator(DynamicMethod method, byte[] methodSignature, int size) 
            : base(method, size)
        {
            m_scope = new DynamicScope();
 
            // Token #1
            int dmMethodToken = m_scope.GetTokenFor(method); 
            Contract.Assert((dmMethodToken & 0x00FFFFFF) == DynamicResolver.TOKENFORDYNAMICMETHOD, "Bad token number!"); 

            // Token #2 
            m_methodSigToken = m_scope.GetTokenFor(methodSignature);
        }
All Usage Examples Of System.Reflection.Emit.DynamicScope::GetTokenFor