Beispiel #1
0
        public override void Emit(OpCode opcode, FieldInfo field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            RuntimeFieldInfo runtimeField = field as RuntimeFieldInfo;

            if (runtimeField == null)
            {
                throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(field));
            }

            int token;

            if (field.DeclaringType == null)
            {
                token = GetTokenFor(runtimeField);
            }
            else
            {
                token = GetTokenFor(runtimeField, runtimeField.GetRuntimeType());
            }

            EnsureCapacity(7);
            InternalEmit(opcode);
            PutInteger4(token);
        }
        public override void Emit(OpCode opcode, FieldInfo field)
        {
            if (field == (FieldInfo)null)
            {
                throw new ArgumentNullException("field");
            }
            RuntimeFieldInfo runtimeField1 = field as RuntimeFieldInfo;

            if ((FieldInfo)runtimeField1 == (FieldInfo)null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), "field");
            }
            int tokenFor;

            if (field.DeclaringType == (Type)null)
            {
                tokenFor = this.GetTokenFor(runtimeField1);
            }
            else
            {
                RuntimeFieldInfo runtimeField2 = runtimeField1;
                RuntimeType      runtimeType   = runtimeField2.GetRuntimeType();
                tokenFor = this.GetTokenFor(runtimeField2, runtimeType);
            }
            this.EnsureCapacity(7);
            this.InternalEmit(opcode);
            this.PutInteger4(tokenFor);
        }
        public override void Emit(OpCode opcode, FieldInfo field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }
            Contract.EndContractBlock();

            RuntimeFieldInfo runtimeField = field as RuntimeFieldInfo;

            if (runtimeField == null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), nameof(field));
            }

            int token;

            if (field.DeclaringType == null)
            {
                token = GetTokenFor(runtimeField);
            }
            else
            {
                token = GetTokenFor(runtimeField, runtimeField.GetRuntimeType());
            }

            EnsureCapacity(7);
            InternalEmit(opcode);
            PutInteger4(token);
        }
Beispiel #4
0
        // Token: 0x060048BE RID: 18622 RVA: 0x001068BC File Offset: 0x00104ABC
        public override void Emit(OpCode opcode, FieldInfo field)
        {
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }
            RuntimeFieldInfo runtimeFieldInfo = field as RuntimeFieldInfo;

            if (runtimeFieldInfo == null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), "field");
            }
            int tokenFor;

            if (field.DeclaringType == null)
            {
                tokenFor = this.GetTokenFor(runtimeFieldInfo);
            }
            else
            {
                tokenFor = this.GetTokenFor(runtimeFieldInfo, runtimeFieldInfo.GetRuntimeType());
            }
            base.EnsureCapacity(7);
            base.InternalEmit(opcode);
            base.PutInteger4(tokenFor);
        }