コード例 #1
0
ファイル: ESNameBinding.cs プロジェクト: vlastik01/cSharp
 public override Expression asCLRSetValueExpression(Expression newValue)
 {
     return(Expression.Condition(
                isMutable,
                Expression.Assign(Expression.ArrayAccess(namedSlots, slotIndex), newValue),
                Expression.Block(
                    TypeGuru.objectType,
                    Expression.Throw(Expression.Constant(new ImmutableObjectException())),
                    newValue)));
 }
コード例 #2
0
        public override Expression Bind(Object[] args, ReadOnlyCollection <ParameterExpression> parameters, LabelTarget returnLabel)
        {
            Expression          testRuleValidityExpression = null;
            Expression          setVariableValueExpression = null;
            ParameterExpression value = parameters[1];

            doAllButFinalBinding(
                args,
                (BindingHandle handle) => {
                testRuleValidityExpression = Expression.Constant(true);
                setVariableValueExpression =
                    Expression.Assign(
                        Expression.Property(Expression.Constant(handle), "Value"),
                        value);
            });

            return(Expression
                   .IfThen(
                       testRuleValidityExpression,
                       Expression.Return(returnLabel, setVariableValueExpression)));
        }
コード例 #3
0
ファイル: ESNameBinding.cs プロジェクト: vlastik01/cSharp
 public override Expression asCLRSetValueExpression(Expression newValue)
 {
     return(Expression.Assign(parameter, newValue));
 }