Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpIsEventBinder"/> class.
 /// </summary>
 /// <param name="name">The name of the member to test.</param>
 /// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param>
 public CSharpIsEventBinder(
     string name,
     Type callingContext)
 {
     Name = name;
     CallingContext = callingContext;
     _binder = RuntimeBinder.GetInstance();
 }
Esempio n. 2
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();
 }
Esempio n. 4
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();
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpConvertBinder" />.
 /// </summary>
 /// <param name="type">The type to convert to.</param>
 /// <param name="conversionKind">The kind of conversion for this operation.</param>
 /// <param name="isChecked">True if the operation is defined in a checked context; otherwise false.</param>        
 public CSharpConvertBinder(
     Type type,
     CSharpConversionKind conversionKind,
     bool isChecked,
     Type callingContext) :
     base(type, conversionKind == CSharpConversionKind.ExplicitConversion)
 {
     ConversionKind = conversionKind;
     IsChecked = isChecked;
     CallingContext = callingContext;
     _binder = RuntimeBinder.GetInstance();
 }
Esempio n. 6
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*/)
 {
     _bResultIndexed = resultIndexed;
     _callingContext = callingContext;
     _argumentInfo = BinderHelper.ToList(argumentInfo);
     _binder = RuntimeBinder.GetInstance();
 }
Esempio n. 7
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();
        }
 /// <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();
 }
Esempio n. 9
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)
        {
            IsCompoundAssignment = isCompoundAssignment;
            IsChecked = isChecked;
            CallingContext = callingContext;
            _argumentInfo = BinderHelper.ToList(argumentInfo);
            _binder = RuntimeBinder.GetInstance();
        }
Esempio n. 10
0
        public static RuntimeBinder GetInstance()
        {
            if (s_instance == null)
            {
                lock (s_singletonLock)
                {
                    if (s_instance == null)
                    {
                        s_instance = new RuntimeBinder();
                    }
                }
            }

            return s_instance;
        }