Microsoft.CSharp.RuntimeBinder.Semantics.EXPR.setArgs C# (CSharp) Method

setArgs() public method

public setArgs ( EXPR args ) : void
args EXPR
return void
        public void setArgs(EXPR args)
        {
            RETAILVERIFY(this.isCALL() || this.isPROP() || this.isFIELD() || this.isARRAYINDEX());
            if (this.isFIELD())
            {
                Debug.Assert(false, "Setting arguments on a field.");
                return;
            }
            switch (kind)
            {
                case ExpressionKind.EK_CALL:
                    this.asCALL().SetOptionalArguments(args);
                    return;

                case ExpressionKind.EK_PROP:
                    this.asPROP().SetOptionalArguments(args);
                    return;

                case ExpressionKind.EK_ARRAYINDEX:
                    this.asARRAYINDEX().SetIndex(args);
                    return;
            }
            Debug.Assert(false, "Shouldn't get here without a CALL, PROP, FIELD or ARRINDEX");
        }

Usage Example

コード例 #1
0
ファイル: ExpressionBinder.cs プロジェクト: dotnet/corefx
        protected void verifyMethodArgs(EXPR call, CType callingObjectType)
        {
            Debug.Assert(call.isCALL() || call.isPROP());

            EXPR argsPtr = call.getArgs();
            SymWithType swt = call.GetSymWithType();
            MethodOrPropertySymbol mp = swt.Sym.AsMethodOrPropertySymbol();
            TypeArray pTypeArgs = call.isCALL() ? call.asCALL().mwi.TypeArgs : null;
            EXPR newArgs;
            AdjustCallArgumentsForParams(callingObjectType, swt.GetType(), mp, pTypeArgs, argsPtr, out newArgs);
            call.setArgs(newArgs);
        }