public CSharpInvokeBinder (CSharpCallFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
			: base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
		{
			this.flags = flags;
			this.callingContext = callingContext;
			this.argumentInfo = argumentInfo.ToReadOnly ();
		}
		public CSharpInvokeMemberBinder (CSharpCallFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
			: base (name, false, CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
		{
			this.flags = flags;
			this.callingContext = callingContext;
			this.argumentInfo = argumentInfo.ToReadOnly ();
			this.typeArguments = typeArguments.ToReadOnly ();
		}
        public __CSharpInvokeMemberBinder(CSharpCallFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
        //: base(name, false, BinderHelper.CreateCallInfo(argumentInfo, 1))
        {





        }
 public CSharpInvokeConstructorBinder(
     CSharpCallFlags flags,
     Type callingContext,
     IEnumerable<CSharpArgumentInfo> argumentInfo)
 {
     _flags = flags;
     _callingContext = callingContext;
     _argumentInfo = BinderHelper.ToList(argumentInfo);
     _binder = RuntimeBinder.GetInstance();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpInvokeBinder" />.
 /// </summary>
 /// <param name="flags">Extra information about this operation that is not specific to any particular argument.</param>
 /// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param>
 /// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
 public CSharpInvokeBinder(
         CSharpCallFlags flags,
         Type callingContext,
         IEnumerable<CSharpArgumentInfo> argumentInfo) :
     base(BinderHelper.CreateCallInfo(argumentInfo, 1)) // discard 1 argument: the target object (even if static, arg is type)
 {
     _flags = flags;
     _callingContext = callingContext;
     _argumentInfo = BinderHelper.ToList(argumentInfo);
     _binder = RuntimeBinder.GetInstance();
 }
Ejemplo n.º 6
0
        public static CallSiteBinder Invoke(
            CSharpBinderFlags flags,
            Type?context,
            IEnumerable <CSharpArgumentInfo>?argumentInfo)
        {
            bool resultDiscarded = (flags & CSharpBinderFlags.ResultDiscarded) != 0;

            CSharpCallFlags callFlags = 0;

            if (resultDiscarded)
            {
                callFlags |= CSharpCallFlags.ResultDiscarded;
            }

            return(new CSharpInvokeBinder(callFlags, context, argumentInfo).TryGetExisting());
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new CSharp invoke member binder.
        /// </summary>
        ///
        /// <returns>
        /// Returns a new CSharp invoke member binder.
        /// </returns>
        /// <param name="flags">The flags with which to initialize the binder.</param><param name="name">The name of the member to invoke.</param><param name="typeArguments">The list of type arguments specified for this invoke.</param><param name="context">The <see cref="T:System.Type"/> that indicates where this operation is used.</param><param name="argumentInfo">The sequence of <see cref="T:Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
        public static CallSiteBinder InvokeMember(CSharpBinderFlags flags, string name, IEnumerable <Type> typeArguments, Type context, IEnumerable <CSharpArgumentInfo> argumentInfo)
        {
            bool            flag1  = (flags & CSharpBinderFlags.InvokeSimpleName) != CSharpBinderFlags.None;
            bool            flag2  = (flags & CSharpBinderFlags.InvokeSpecialName) != CSharpBinderFlags.None;
            bool            flag3  = (flags & CSharpBinderFlags.ResultDiscarded) != CSharpBinderFlags.None;
            CSharpCallFlags flags1 = CSharpCallFlags.None;

            if (flag1)
            {
                flags1 |= CSharpCallFlags.SimpleNameCall;
            }
            if (flag2)
            {
                flags1 |= CSharpCallFlags.EventHookup;
            }
            if (flag3)
            {
                flags1 |= CSharpCallFlags.ResultDiscarded;
            }
            return((CallSiteBinder) new CSharpInvokeMemberBinder(flags1, name, context, typeArguments, argumentInfo));
        }
Ejemplo n.º 8
0
 public __CSharpInvokeMemberBinder(CSharpCallFlags flags, string name, Type callingContext, IEnumerable <Type> typeArguments, IEnumerable <CSharpArgumentInfo> argumentInfo)
 //: base(name, false, BinderHelper.CreateCallInfo(argumentInfo, 1))
 {
 }