Exemplo n.º 1
0
        private PipelineContext(ILogger logger, PSRuleOption option, HostContext hostContext, TargetBinder binder, BaselineContext baseline, IDictionary <string, ResourceRef> unresolved)
        {
            _ObjectNumber = -1;
            _Logger       = logger;
            _RuleTimer    = new Stopwatch();

            Option = option;

            HostContext = hostContext;

            _LanguageMode = option.Execution.LanguageMode ?? ExecutionOption.Default.LanguageMode.Value;

            _InconclusiveWarning = option.Execution.InconclusiveWarning ?? ExecutionOption.Default.InconclusiveWarning.Value;
            _NotProcessedWarning = option.Execution.NotProcessedWarning ?? ExecutionOption.Default.NotProcessedWarning.Value;
            _FailStream          = option.Logging.RuleFail ?? LoggingOption.Default.RuleFail.Value;
            _PassStream          = option.Logging.RulePass ?? LoggingOption.Default.RulePass.Value;

            _NameTokenCache = new Dictionary <string, NameToken>();
            DataCache       = new Dictionary <string, Hashtable>();
            ExpressionCache = new Dictionary <string, object>();

            _Reason     = new List <string>();
            _Binder     = binder;
            Baseline    = baseline;
            _Unresolved = unresolved;
            Culture     = option.Output.Culture;
        }
Exemplo n.º 2
0
        internal RunspaceContext(PipelineContext pipeline, PipelineWriter writer)
        {
            Writer        = writer;
            CurrentThread = this;
            Pipeline      = pipeline;

            _InconclusiveWarning = Pipeline.Option.Execution.InconclusiveWarning ?? ExecutionOption.Default.InconclusiveWarning.Value;
            _NotProcessedWarning = Pipeline.Option.Execution.NotProcessedWarning ?? ExecutionOption.Default.NotProcessedWarning.Value;
            _FailStream          = Pipeline.Option.Logging.RuleFail ?? LoggingOption.Default.RuleFail.Value;
            _PassStream          = Pipeline.Option.Logging.RulePass ?? LoggingOption.Default.RulePass.Value;

            _ObjectNumber = -1;
            _RuleTimer    = new Stopwatch();
            _Reason       = new List <string>();
        }