Exemplo n.º 1
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="callingContext">The <see cref="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 CSharpUnaryOperationBinder(
     ExpressionType operation,
     bool isChecked,
     Type callingContext,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(operation)
 {
     _argumentInfo = BinderHelper.ToArray(argumentInfo);
     Debug.Assert(_argumentInfo.Length == 1);
     _callingContext = callingContext;
     _binder         = new RuntimeBinder(callingContext, isChecked);
 }
Exemplo n.º 2
0
 /// <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*/)
 {
     ResultIndexed   = resultIndexed;
     _argumentInfo   = BinderHelper.ToArray(argumentInfo);
     _callingContext = callingContext;
     _binder         = new RuntimeBinder(callingContext);
 }
Exemplo n.º 3
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="isChecked">True if the operation is defined in a checked context; otherwise, false.</param>
        /// <param name="callingContext">The <see cref="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)
        {
            IsCompoundAssignment = isCompoundAssignment;
            _argumentInfo        = BinderHelper.ToArray(argumentInfo);
            _binder = new RuntimeBinder(callingContext, isChecked);
        }
Exemplo n.º 4
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="isChecked">True if the operation is defined in a checked context; otherwise, false.</param>
        /// <param name="callingContext">The <see cref="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
        {
            IsCompoundAssignment = isCompoundAssignment;
            IsChecked            = isChecked;
            CallingContext       = callingContext;
            _argumentInfo        = BinderHelper.ToArray(argumentInfo);
            _binder = RuntimeBinder.GetInstance();
        }
Exemplo n.º 5
0
 public CSharpInvokeMemberBinder(
     CSharpCallFlags flags,
     string name,
     Type callingContext,
     IEnumerable <Type> typeArguments,
     IEnumerable <CSharpArgumentInfo> argumentInfo) :
     base(name, false, BinderHelper.CreateCallInfo(ref argumentInfo, 1)) // discard 1 argument: the target object (even if static, arg is type)
 {
     Flags          = flags;
     CallingContext = callingContext;
     TypeArguments  = BinderHelper.ToArray(typeArguments);
     _argumentInfo  = BinderHelper.ToArray(argumentInfo);
     _binder        = new RuntimeBinder(callingContext);
 }
        //////////////////////////////////////////////////////////////////////

        /// <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="callingContext">The <see cref="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 CSharpBinaryOperationBinder(
            ExpressionType operation,
            bool isChecked,
            CSharpBinaryOperationFlags binaryOperationFlags,
            Type callingContext,
            IEnumerable <CSharpArgumentInfo> argumentInfo) :
            base(operation)
        {
            IsChecked      = isChecked;
            _binopFlags    = binaryOperationFlags;
            CallingContext = callingContext;
            _argumentInfo  = BinderHelper.ToArray(argumentInfo);
            Debug.Assert(_argumentInfo.Length == 2);
            _binder = RuntimeBinder.GetInstance();
        }