コード例 #1
0
        public override bool Equals(object obj)
        {
            PythonUnaryOperationBinder ob = obj as PythonUnaryOperationBinder;

            if (ob == null)
            {
                return(false);
            }

            return(ob._context.Binder == _context.Binder && base.Equals(obj));
        }
コード例 #2
0
ファイル: BinderState.cs プロジェクト: jxnmaomao/ironruby
        internal PythonUnaryOperationBinder/*!*/ UnaryOperation(ExpressionType operation) {
            if (_unaryBinders == null) {
                Interlocked.CompareExchange(
                    ref _unaryBinders,
                    new Dictionary<ExpressionType, PythonUnaryOperationBinder>(),
                    null
                );
            }

            lock (_unaryBinders) {
                PythonUnaryOperationBinder res;
                if (!_unaryBinders.TryGetValue(operation, out res)) {
                    _unaryBinders[operation] = res = new PythonUnaryOperationBinder(this, operation);
                }

                return res;
            }

        }