Exemplo n.º 1
0
        public ContextualOperand This()
        {
            if (Context.IsStatic)
            {
                throw new InvalidOperationException(Properties.Messages.ErrCodeStaticThis);
            }

            Type ownerType = Context.OwnerType;

            if (Context.OwnerType.IsValueType)
            {
                var m = Context.Member as MethodInfo;
                if (m != null && m.IsVirtual)
                {
                    ownerType = ownerType.MakeByRefType();
                }
            }

            Operand arg = new _Arg(0, ownerType);

            return(new ContextualOperand(arg, TypeMapper));
        }
Exemplo n.º 2
0
		public ContextualOperand This()
		{
			if (Context.IsStatic)
				throw new InvalidOperationException(Properties.Messages.ErrCodeStaticThis);

		    Type ownerType = Context.OwnerType;
            
		    if (Context.OwnerType.IsValueType)
		    {
		        var m = Context.Member as MethodInfo;
		        if (m != null && m.IsVirtual)
		            ownerType = ownerType.MakeByRefType();
		    }

		    Operand arg = new _Arg(0, ownerType);
            return new ContextualOperand(arg, TypeMapper);
		}