• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IScriptExtent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IScriptExtent的典型用法代码示例。如果您正苦于以下问题:C# IScriptExtent类的具体用法?C# IScriptExtent怎么用?C# IScriptExtent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IScriptExtent类属于命名空间,在下文中一共展示了IScriptExtent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TryStatementAst

 public TryStatementAst(IScriptExtent extent, StatementBlockAst body, IEnumerable<CatchClauseAst> catchClauses, StatementBlockAst @finally)
     : base(extent)
 {
     this.Body = body;
     this.CatchClauses = catchClauses.ToReadOnlyCollection();
     this.Finally = @finally;
 }
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:TryStatementAst.cs


示例2: InvocationInfo

        /// <summary>
        /// Constructor for InvocationInfo object
        /// </summary>
        /// 
        /// <param name="commandInfo">
        /// The command information the invocation info represents.
        /// </param>
        /// 
        /// <param name="scriptPosition">
        /// The position representing the invocation, or the position representing the error.
        /// </param>
        /// 
        /// <param name="context">
        /// The context in which the InvocationInfo is being created.
        /// </param>
        /// 
        internal InvocationInfo(CommandInfo commandInfo, IScriptExtent scriptPosition, ExecutionContext context)
        {
            MyCommand = commandInfo;
            CommandOrigin = CommandOrigin.Internal;
            _scriptPosition = scriptPosition;

            ExecutionContext contextToUse = null;
            if ((commandInfo != null) && (commandInfo.Context != null))
            {
                contextToUse = commandInfo.Context;
            }
            else if (context != null)
            {
                contextToUse = context;
            }

            // Populate the history ID of this command
            if (contextToUse != null)
            {
                Runspaces.LocalRunspace localRunspace = contextToUse.CurrentRunspace as Runspaces.LocalRunspace;
                if (localRunspace != null && localRunspace.History != null)
                {
                    HistoryId = localRunspace.History.GetNextHistoryId();
                }
            }
        }
开发者ID:dfinke,项目名称:powershell,代码行数:42,代码来源:InvocationInfo.cs


示例3: DataStatementAst

 public DataStatementAst(IScriptExtent extent, string variableName, IEnumerable<ExpressionAst> commandsAllowed, StatementBlockAst body) : base(extent)
 {
     this._tupleIndex = -1;
     if (body == null)
     {
         throw PSTraceSource.NewArgumentNullException("body");
     }
     if (string.IsNullOrWhiteSpace(variableName))
     {
         variableName = null;
     }
     this.Variable = variableName;
     if ((commandsAllowed != null) && commandsAllowed.Any<ExpressionAst>())
     {
         this.CommandsAllowed = new ReadOnlyCollection<ExpressionAst>(commandsAllowed.ToArray<ExpressionAst>());
         base.SetParents((IEnumerable<Ast>) this.CommandsAllowed);
         this.HasNonConstantAllowedCommand = (from ast in this.CommandsAllowed
             where !(ast is StringConstantExpressionAst)
             select ast).Any<ExpressionAst>();
     }
     else
     {
         this.CommandsAllowed = new ReadOnlyCollection<ExpressionAst>(EmptyCommandsAllowed);
     }
     this.Body = body;
     base.SetParent(body);
 }
开发者ID:nickchal,项目名称:pash,代码行数:27,代码来源:DataStatementAst.cs


示例4: ScriptBlockAst

 public ScriptBlockAst(IScriptExtent extent, ParamBlockAst paramBlock, NamedBlockAst beginBlock, NamedBlockAst processBlock, NamedBlockAst endBlock, NamedBlockAst dynamicParamBlock) : base(extent)
 {
     if (paramBlock != null)
     {
         this.ParamBlock = paramBlock;
         base.SetParent(paramBlock);
     }
     if (beginBlock != null)
     {
         this.BeginBlock = beginBlock;
         base.SetParent(beginBlock);
     }
     if (processBlock != null)
     {
         this.ProcessBlock = processBlock;
         base.SetParent(processBlock);
     }
     if (endBlock != null)
     {
         this.EndBlock = endBlock;
         base.SetParent(endBlock);
     }
     if (dynamicParamBlock != null)
     {
         this.DynamicParamBlock = dynamicParamBlock;
         base.SetParent(dynamicParamBlock);
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:28,代码来源:ScriptBlockAst.cs


示例5: CommandParameterAst

 public CommandParameterAst(IScriptExtent extent, string parameterName, ExpressionAst argument, IScriptExtent errorPosition)
     : base(extent)
 {
     this.ParameterName = parameterName;
     this.Argument = argument;
     this.ErrorPosition = errorPosition;
 }
开发者ID:JamesTryand,项目名称:Pash2,代码行数:7,代码来源:CommandParameterAst.cs


示例6: ExpandableStringExpressionAst

 public ExpandableStringExpressionAst(IScriptExtent extent, string value, System.Management.Automation.Language.StringConstantType type) : base(extent)
 {
     if (value == null)
     {
         throw PSTraceSource.NewArgumentNullException("value");
     }
     if (((type != System.Management.Automation.Language.StringConstantType.DoubleQuoted) && (type != System.Management.Automation.Language.StringConstantType.DoubleQuotedHereString)) && (type != System.Management.Automation.Language.StringConstantType.BareWord))
     {
         throw PSTraceSource.NewArgumentException("type");
     }
     ExpressionAst ast = Parser.ScanString(value);
     ExpandableStringExpressionAst ast2 = ast as ExpandableStringExpressionAst;
     if (ast2 != null)
     {
         this.FormatExpression = ast2.FormatExpression;
         this.NestedExpressions = ast2.NestedExpressions;
     }
     else
     {
         this.FormatExpression = "{0}";
         this.NestedExpressions = new ReadOnlyCollection<ExpressionAst>(new ExpressionAst[] { ast });
     }
     this.Value = value;
     this.StringConstantType = type;
 }
开发者ID:nickchal,项目名称:pash,代码行数:25,代码来源:ExpandableStringExpressionAst.cs


示例7: ErrorStatementAst

 internal ErrorStatementAst(IScriptExtent extent, Token kind, IEnumerable<KeyValuePair<string, Tuple<Token, Ast>>> flags, IEnumerable<Ast> conditions, IEnumerable<Ast> bodies) : base(extent)
 {
     if (kind == null)
     {
         throw PSTraceSource.NewArgumentNullException("kind");
     }
     this.Kind = kind;
     if ((flags != null) && flags.Any<KeyValuePair<string, Tuple<Token, Ast>>>())
     {
         this.Flags = new Dictionary<string, Tuple<Token, Ast>>(StringComparer.OrdinalIgnoreCase);
         foreach (KeyValuePair<string, Tuple<Token, Ast>> pair in flags)
         {
             if (!this.Flags.ContainsKey(pair.Key))
             {
                 this.Flags.Add(pair.Key, pair.Value);
                 if (pair.Value.Item2 != null)
                 {
                     base.SetParent(pair.Value.Item2);
                 }
             }
         }
     }
     if ((conditions != null) && conditions.Any<Ast>())
     {
         this.Conditions = new ReadOnlyCollection<Ast>(conditions.ToArray<Ast>());
         base.SetParents(conditions);
     }
     if ((bodies != null) && bodies.Any<Ast>())
     {
         this.Bodies = new ReadOnlyCollection<Ast>(bodies.ToArray<Ast>());
         base.SetParents(bodies);
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:33,代码来源:ErrorStatementAst.cs


示例8: SwitchStatementAst

 public SwitchStatementAst(IScriptExtent extent, string label, PipelineBaseAst condition, SwitchFlags flags, IEnumerable<Tuple<ExpressionAst, StatementBlockAst>> clauses, StatementBlockAst @default)
     : base(extent, label, condition)
 {
     this.Flags = flags;
     this.Clauses = clauses.ToReadOnlyCollection();
     this.Default = @default;
 }
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:SwitchStatementAst.cs


示例9: FunctionDefinitionAst

 public FunctionDefinitionAst(IScriptExtent extent, bool isFilter, bool isWorkflow, string name, IEnumerable<ParameterAst> parameters, ScriptBlockAst body) : base(extent)
 {
     if (string.IsNullOrEmpty(name))
     {
         throw PSTraceSource.NewArgumentNullException("name");
     }
     if (body == null)
     {
         throw PSTraceSource.NewArgumentNullException("body");
     }
     if (isFilter && isWorkflow)
     {
         throw PSTraceSource.NewArgumentException("isFilter");
     }
     this.IsFilter = isFilter;
     this.IsWorkflow = isWorkflow;
     this.Name = name;
     if ((parameters != null) && parameters.Any<ParameterAst>())
     {
         this.Parameters = new ReadOnlyCollection<ParameterAst>(parameters.ToArray<ParameterAst>());
         base.SetParents((IEnumerable<Ast>) this.Parameters);
     }
     this.Body = body;
     base.SetParent(body);
 }
开发者ID:nickchal,项目名称:pash,代码行数:25,代码来源:FunctionDefinitionAst.cs


示例10: ParseError

 internal ParseError(IScriptExtent extent, string errorId, string message, bool incompleteInput)
 {
     this._extent = extent;
     this._errorId = errorId;
     this._message = message;
     this._incompleteInput = incompleteInput;
 }
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ParseError.cs


示例11: ParameterAst

 public ParameterAst(IScriptExtent extent, VariableExpressionAst name, IEnumerable<AttributeBaseAst> attributes, ExpressionAst defaultValue)
     : base(extent)
 {
     this.Name = name;
     this.Attributes = attributes.ToReadOnlyCollection();
     this.DefaultValue = defaultValue;
 }
开发者ID:JamesTryand,项目名称:Pash2,代码行数:7,代码来源:ParameterAst.cs


示例12: SetUp

        public void SetUp()
        {
            extent = Substitute.For<IScriptExtent>();
            argument = new VariableExpressionAst(extent, "other", false);

            visitor = new FindTypeDefinitionVisitor();
        }
开发者ID:cmanrus,项目名称:challenge,代码行数:7,代码来源:FindTypeDefinitionVisitor_Tests.cs


示例13: UpdatePositionExpr

 public UpdatePositionExpr(IScriptExtent extent, int sequencePoint, SymbolDocumentInfo debugSymbolDocument, bool checkBreakpoints)
 {
     this._extent = extent;
     this._checkBreakpoints = checkBreakpoints;
     this._debugSymbolDocument = debugSymbolDocument;
     this._sequencePoint = sequencePoint;
 }
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:UpdatePositionExpr.cs


示例14: DataStatementAst

 public DataStatementAst(IScriptExtent extent, string variableName, IEnumerable<ExpressionAst> commandsAllowed, StatementBlockAst body)
     : base(extent)
 {
     this.Variable = variableName;
     this.CommandsAllowed = commandsAllowed.ToReadOnlyCollection();
     this.Body = body;
 }
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:DataStatementAst.cs


示例15: MemberExpressionAst

 public MemberExpressionAst(IScriptExtent extent, ExpressionAst expression, CommandElementAst member, bool @static)
     : base(extent)
 {
     this.Expression = expression;
     this.Member = member;
     this.Static = @static;
 }
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:MemberExpressionAst.cs


示例16: TryStatementAst

 public TryStatementAst(IScriptExtent extent, StatementBlockAst body, IEnumerable<CatchClauseAst> catchClauses, StatementBlockAst @finally) : base(extent)
 {
     if (body == null)
     {
         throw PSTraceSource.NewArgumentNullException("body");
     }
     if (((catchClauses == null) || !catchClauses.Any<CatchClauseAst>()) && (@finally == null))
     {
         throw PSTraceSource.NewArgumentException("catchClauses");
     }
     this.Body = body;
     base.SetParent(body);
     if ((catchClauses != null) && catchClauses.Any<CatchClauseAst>())
     {
         this.CatchClauses = new ReadOnlyCollection<CatchClauseAst>(catchClauses.ToArray<CatchClauseAst>());
         base.SetParents((IEnumerable<Ast>) this.CatchClauses);
     }
     else
     {
         this.CatchClauses = EmptyCatchClauses;
     }
     if (@finally != null)
     {
         this.Finally = @finally;
         base.SetParent(@finally);
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:27,代码来源:TryStatementAst.cs


示例17: ScriptBlockAst

 public ScriptBlockAst(IScriptExtent extent, ParamBlockAst paramBlock, StatementBlockAst statements, bool isFilter)
     : base(extent)
 {
     this.ParamBlock = paramBlock;
     this.EndBlock = new NamedBlockAst(extent, TokenKind.End, statements, true);
     if (isFilter) throw new NotImplementedException(this.ToString());
 }
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:ScriptBlockAst.cs


示例18: NamedAttributeArgumentAst

 public NamedAttributeArgumentAst(IScriptExtent extent, string argumentName, ExpressionAst argument, bool expressionOmitted)
     : base(extent)
 {
     this.Argument = argument;
     this.ArgumentName = argumentName;
     this.ExpressionOmitted = expressionOmitted;
 }
开发者ID:JamesTryand,项目名称:Pash2,代码行数:7,代码来源:NamedAttributeArgumentAst.cs


示例19: AssignmentStatementAst

 public AssignmentStatementAst(IScriptExtent extent, ExpressionAst left, TokenKind @operator, StatementAst right, IScriptExtent errorPosition) : base(extent)
 {
     if (((left == null) || (right == null)) || (errorPosition == null))
     {
         throw PSTraceSource.NewArgumentNullException((left == null) ? "left" : ((right == null) ? "right" : "errorPosition"));
     }
     if ((@operator.GetTraits() & TokenFlags.AssignmentOperator) == TokenFlags.None)
     {
         throw PSTraceSource.NewArgumentException("operator");
     }
     PipelineAst ast = right as PipelineAst;
     if ((ast != null) && (ast.PipelineElements.Count == 1))
     {
         CommandExpressionAst ast2 = ast.PipelineElements[0] as CommandExpressionAst;
         if (ast2 != null)
         {
             right = ast2;
             right.ClearParent();
         }
     }
     this.Operator = @operator;
     this.Left = left;
     base.SetParent(left);
     this.Right = right;
     base.SetParent(right);
     this.ErrorPosition = errorPosition;
 }
开发者ID:nickchal,项目名称:pash,代码行数:27,代码来源:AssignmentStatementAst.cs


示例20: DoUntilStatementAst

 public DoUntilStatementAst(IScriptExtent extent, string label, PipelineBaseAst condition, StatementBlockAst body) : base(extent, label, condition, body)
 {
     if (condition == null)
     {
         throw PSTraceSource.NewArgumentNullException("condition");
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DoUntilStatementAst.cs



注:本文中的IScriptExtent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IScriptInstance类代码示例发布时间:2022-05-24
下一篇:
C# IScriptEngine类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap