private void BuildMethodReferences() { descendRef = MethodRef(typeof(IQuery), "descend", new[] { typeof(string) }); constrainRef = MethodRef(typeof(IQuery), "constrain", new[] { typeof(object) }); greaterRef = MethodRef(typeof(IConstraint), "greater", new Type[] {}); smallerRef = MethodRef(typeof(IConstraint), "smaller", new Type[] {}); containsRef = MethodRef(typeof(IConstraint), "contains", new Type[] {}); startsWithRef = MethodRef(typeof(IConstraint), "startsWith", new[] { typeof( bool) }); endsWithRef = MethodRef(typeof(IConstraint), "endsWith", new[] { typeof(bool ) }); notRef = MethodRef(typeof(IConstraint), "not", new Type[] {}); andRef = MethodRef(typeof(IConstraint), "and", new[] { typeof(IConstraint) } ); orRef = MethodRef(typeof(IConstraint), "or", new[] { typeof(IConstraint) }); identityRef = MethodRef(typeof(IConstraint), "identity", new Type[] {}); }
public MethodCallValue(IMethodRef method, Db4objects.Db4o.Instrumentation.Api.CallingConvention callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) : base(parent) { _method = method; _args = args; _callingConvention = callingConvention; }
public MethodCallValue(IMethodRef method, CallingConvention callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) : base(parent) { _method = method; _args = args; _callingConvention = callingConvention; }
public override bool Equals(object obj) { if (!(obj is IMethodRef)) { return(false); } IMethodRef other = (IMethodRef)obj; return(Name.Equals(other.Name) && Check.ObjectsAreEqual(DeclaringType, other.DeclaringType ) && Check.ObjectsAreEqual(ReturnType, other.ReturnType) && Check.ArraysAreEqual (ParamTypes, other.ParamTypes)); }
public virtual void Visit(MethodCallValue operand) { IMethodRef method = operand.Method; ITypeRef retType = method.ReturnType; // FIXME: this should be handled within conversions bool needConversion = retType.IsPrimitive; operand.Parent().Accept(this); bool oldInArithmetic = _inArithmetic; for (int paramIdx = 0; paramIdx < operand.Args.Length; paramIdx++) { _inArithmetic = operand.Method.ParamTypes[paramIdx].IsPrimitive; operand.Args[paramIdx].Accept(this); } _inArithmetic = oldInArithmetic; _methodBuilder.Invoke(method, operand.CallingConvention); Box(retType, !_inArithmetic && needConversion); }
public void Invoke(IMethodRef method, CallingConvention convention) { _il.Emit(OpCodeForConvention(convention), CecilMethodRef.GetReference(method)); }
public MethodInfo Resolve(IMethodRef methodRef) { throw new NotImplementedException(); }
private void Invoke(IMethodRef method) { _builder.Invoke(method, CallingConvention.Interface); }
private void BuildMethodReferences() { descendRef = MethodRef(typeof(IQuery), "descend", new Type[] { typeof(string) }); constrainRef = MethodRef(typeof(IQuery), "constrain", new Type[] { typeof(object) }); greaterRef = MethodRef(typeof(IConstraint), "greater", new Type[] { }); smallerRef = MethodRef(typeof(IConstraint), "smaller", new Type[] { }); containsRef = MethodRef(typeof(IConstraint), "contains", new Type[] { }); startsWithRef = MethodRef(typeof(IConstraint), "startsWith", new Type[] { typeof( bool) }); endsWithRef = MethodRef(typeof(IConstraint), "endsWith", new Type[] { typeof(bool ) }); notRef = MethodRef(typeof(IConstraint), "not", new Type[] { }); andRef = MethodRef(typeof(IConstraint), "and", new Type[] { typeof(IConstraint) } ); orRef = MethodRef(typeof(IConstraint), "or", new Type[] { typeof(IConstraint) }); identityRef = MethodRef(typeof(IConstraint), "identity", new Type[] { }); }