Beispiel #1
0
        internal void Initialize(MshExpressionFactory expressionFactory, TypeInfoDataBase db)
        {
            this.expressionFactory = expressionFactory;
            this.typeInfoDatabase  = db;
            FormatErrorPolicy formatErrorPolicy = new FormatErrorPolicy {
                ShowErrorsAsMessages        = this.typeInfoDatabase.defaultSettingsSection.formatErrorPolicy.ShowErrorsAsMessages,
                ShowErrorsInFormattedOutput = this.typeInfoDatabase.defaultSettingsSection.formatErrorPolicy.ShowErrorsInFormattedOutput
            };

            this.errorManager = new FormatErrorManager(formatErrorPolicy);
        }
 protected override void BeginProcessing()
 {
     this.expressionFactory = new MshExpressionFactory();
     if (this.title != null)
     {
         this.windowProxy = new OutWindowProxy(this.title, this.outputMode, this);
     }
     else
     {
         this.windowProxy = new OutWindowProxy(base.MyInvocation.Line, this.outputMode, this);
     }
     this.typeInfoDataBase = base.Context.FormatDBManager.GetTypeInfoDataBase();
 }
Beispiel #3
0
        internal void Initialize(MshExpressionFactory expressionFactory,
                                 TypeInfoDataBase db)
        {
            _expressionFactory = expressionFactory;
            _typeInfoDatabase  = db;

            // Initialize Format Error Manager.
            FormatErrorPolicy formatErrorPolicy = new FormatErrorPolicy();

            formatErrorPolicy.ShowErrorsAsMessages        = _typeInfoDatabase.defaultSettingsSection.formatErrorPolicy.ShowErrorsAsMessages;
            formatErrorPolicy.ShowErrorsInFormattedOutput = _typeInfoDatabase.defaultSettingsSection.formatErrorPolicy.ShowErrorsInFormattedOutput;

            _errorManager = new FormatErrorManager(formatErrorPolicy);
        }
Beispiel #4
0
        /// <summary>
        /// Provides a one-time, pre-processing functionality for the cmdlet.
        /// </summary>
        protected override void BeginProcessing()
        {
            // Set up the ExpressionFactory
            _expressionFactory = new MshExpressionFactory();

            // If the value of the Title parameter is valid, use it as a window's title.
            if (this.Title != null)
            {
                _windowProxy = new OutWindowProxy(this.Title, OutputMode, this);
            }
            else
            {
                // Using the command line as a title.
                _windowProxy = new OutWindowProxy(this.MyInvocation.Line, OutputMode, this);
            }

            // Load the Type info database.
            _typeInfoDataBase = this.Context.FormatDBManager.GetTypeInfoDataBase();
        }