Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpGetIndexBinder" />.
 /// </summary>
 /// <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 CSharpGetIndexBinder(
     Type callingContext,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(BinderHelper.CreateCallInfo(argumentInfo, 1)) // discard 1 argument: the target object
 {
     CallingContext = callingContext;
     _argumentInfo  = BinderHelper.ToList(argumentInfo);
     _binder        = RuntimeBinder.GetInstance();
 }
 public CSharpInvokeConstructorBinder(
     CSharpCallFlags flags,
     Type callingContext,
     IEnumerable <CSharpArgumentInfo> argumentInfo)
 {
     _flags          = flags;
     _callingContext = callingContext;
     _argumentInfo   = BinderHelper.ToList(argumentInfo);
     _binder         = RuntimeBinder.GetInstance();
 }
Example #3
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();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpGetMemberBinder" />.
 /// </summary>
 /// <param name="name">The name of the member to get.</param>
 /// <param name="resultIndexed">Determines if COM binder should return a callable object.</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 CSharpGetMemberBinder(
     string name,
     bool resultIndexed,
     Type callingContext,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(name, false /*caseInsensitive*/)
 {
     _bResultIndexed = resultIndexed;
     _callingContext = callingContext;
     _argumentInfo   = BinderHelper.ToList(argumentInfo);
     _binder         = RuntimeBinder.GetInstance();
 }
Example #5
0
        //////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpSetIndexBinder" />.
        /// </summary>
        /// <param name="isCompoundAssignment">True if the assignment comes from a compound assignment in source.</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 CSharpSetIndexBinder(
            bool isCompoundAssignment,
            bool isChecked,
            Type callingContext,
            IEnumerable <CSharpArgumentInfo> argumentInfo) :
            base(BinderHelper.CreateCallInfo(argumentInfo, 2)) // discard 2 arguments: the target object and the value
        {
            _bIsCompoundAssignment = isCompoundAssignment;
            _isChecked             = isChecked;
            _callingContext        = callingContext;
            _argumentInfo          = BinderHelper.ToList(argumentInfo);
            _binder = RuntimeBinder.GetInstance();
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpUnaryOperationBinder"/> class.
 /// </summary>
 /// <param name="operation">The unary operation kind.</param>
 /// <param name="isChecked">True if the operation is defined in a checked context; otherwise, false.</param>
 /// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
 public CSharpUnaryOperationBinder(
     ExpressionType operation,
     bool isChecked,
     Type callingContext,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(operation)
 {
     IsChecked      = isChecked;
     CallingContext = callingContext;
     _argumentInfo  = BinderHelper.ToList(argumentInfo);
     Debug.Assert(_argumentInfo.Count == 1);
     _binder = RuntimeBinder.GetInstance();
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpInvokeMemberBinder" />.
 /// </summary>
 /// <param name="flags">Extra information about this operation that is not specific to any particular argument.</param>
 /// <param name="name">The name of the member to invoke.</param>
 /// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param>
 /// <param name="typeArguments">The list of user-specified type arguments to this call.</param>
 /// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
 public CSharpInvokeMemberBinder(
     CSharpCallFlags flags,
     string name,
     Type callingContext,
     IEnumerable <Type> typeArguments,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(name, false, BinderHelper.CreateCallInfo(argumentInfo, 1)) // discard 1 argument: the target object (even if static, arg is type)
 {
     Flags          = flags;
     CallingContext = callingContext;
     _typeArguments = BinderHelper.ToList(typeArguments);
     _argumentInfo  = BinderHelper.ToList(argumentInfo);
     _binder        = RuntimeBinder.GetInstance();
 }
Example #8
0
        //////////////////////////////////////////////////////////////////////


        /// <summary>
        /// Initializes a new instance of the <see cref="SetMemberBinder" />.
        /// </summary>
        /// <param name="name">The name of the member to get.</param>
        /// <param name="isCompoundAssignment">True if the assignment comes from a compound assignment in source.</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 CSharpSetMemberBinder(
            string name,
            bool isCompoundAssignment,
            bool isChecked,
            Type callingContext,
            IEnumerable <CSharpArgumentInfo> argumentInfo) :
            base(name, false)
        {
            _bIsCompoundAssignment = isCompoundAssignment;
            _isChecked             = isChecked;
            _callingContext        = callingContext;
            _argumentInfo          = BinderHelper.ToList(argumentInfo);
            _binder = RuntimeBinder.GetInstance();
        }
Example #9
0
        //////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpBinaryOperationBinder"/> class.
        /// </summary>
        /// <param name="operation">The binary operation kind.</param>
        /// <param name="isChecked">True if the operation is defined in a checked context; otherwise false.</param>
        /// <param name="binaryOperationFlags">The flags associated with this binary operation.</param>
        /// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
        public CSharpBinaryOperationBinder(
            ExpressionType operation,
            bool isChecked,
            CSharpBinaryOperationFlags binaryOperationFlags,
            Type callingContext,
            IEnumerable <CSharpArgumentInfo> argumentInfo) :
            base(operation)
        {
            m_isChecked      = isChecked;
            m_binopFlags     = binaryOperationFlags;
            m_callingContext = callingContext;
            m_argumentInfo   = BinderHelper.ToList(argumentInfo);
            Debug.Assert(m_argumentInfo.Count == 2);
            m_binder = RuntimeBinder.GetInstance();
        }