コード例 #1
0
 public static ScriptBlockAst Update(
     this ScriptBlockAst ast,
     IEnumerable <UsingStatementAst> usingStatements = null,
     IEnumerable <AttributeAst> attributes           = null,
     ParamBlockAst paramBlock        = null,
     NamedBlockAst beginBlock        = null,
     NamedBlockAst processBlock      = null,
     NamedBlockAst endBlock          = null,
     NamedBlockAst dynamicParamBlock = null)
 {
     return(new ScriptBlockAst(
                ast.Extent,
                usingStatements?.CloneAll() ?? ast.UsingStatements?.CloneAll(),
                attributes?.CloneAll() ?? ast.Attributes?.CloneAll(),
                paramBlock?.Clone() ?? ast.ParamBlock?.Clone(),
                beginBlock?.Clone() ?? ast.BeginBlock?.Clone(),
                processBlock?.Clone() ?? ast.ProcessBlock?.Clone(),
                endBlock?.Clone() ?? ast.EndBlock?.Clone(),
                dynamicParamBlock?.Clone() ?? ast.DynamicParamBlock?.Clone()));
 }
コード例 #2
0
 public static ScriptBlockAst Update(
     this ScriptBlockAst ast,
     IEnumerable <StatementAst> statements,
     IEnumerable <UsingStatementAst> usingStatements = null,
     IEnumerable <AttributeAst> attributes           = null,
     ParamBlockAst paramBlock = null,
     bool?isFilter            = null,
     bool?isConfiguration     = null)
 {
     return(new ScriptBlockAst(
                ast.Extent,
                usingStatements?.CloneAll() ?? ast.UsingStatements?.CloneAll(),
                attributes?.CloneAll() ?? ast.Attributes?.CloneAll(),
                paramBlock?.Clone() ?? ast.ParamBlock?.Clone(),
                new StatementBlockAst(
                    ast.EndBlock.Extent,
                    statements?.CloneAll() ?? ast.EndBlock?.Statements?.CloneAll(),
                    ast.EndBlock?.Traps?.CloneAll()),
                isFilter: false,
                isConfiguration: false));
 }