コード例 #1
0
 private void InitializeCommon(AutomationEngine engine, PSHost hostInterface)
 {
     this._engine = engine;
     if (!_assemblyEventHandlerSet)
     {
         lock (lockObject)
         {
             if (!_assemblyEventHandlerSet)
             {
                 AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ExecutionContext.PowerShellAssemblyResolveHandler);
                 _assemblyEventHandlerSet = true;
             }
         }
     }
     this._debugger          = new System.Management.Automation.Debugger(this);
     this.eventManager       = new PSLocalEventManager(this);
     this.transactionManager = new PSTransactionManager();
     this.myHostInterface    = hostInterface as System.Management.Automation.Internal.Host.InternalHost;
     if (this.myHostInterface == null)
     {
         this.myHostInterface = new System.Management.Automation.Internal.Host.InternalHost(hostInterface, this);
     }
     this._assemblyCache        = new Dictionary <string, Assembly>();
     this._topLevelSessionState = this._engineSessionState = new SessionStateInternal(this);
     if (this._authorizationManager == null)
     {
         this._authorizationManager = new System.Management.Automation.AuthorizationManager(null);
     }
     this._modules = new ModuleIntrinsics(this);
 }
コード例 #2
0
        InternalHostUserInterface(PSHostUserInterface externalUI, InternalHost parentHost)
        {
            // externalUI may be null

            _externalUI = externalUI;

            // parent may not be null, however

            Dbg.Assert(parentHost != null, "parent may not be null");
            if (parentHost == null)
            {
                throw PSTraceSource.NewArgumentNullException(nameof(parentHost));
            }

            _parent = parentHost;

            PSHostRawUserInterface rawui = null;

            if (externalUI != null)
            {
                rawui = externalUI.RawUI;
            }

            _internalRawUI = new InternalHostRawUserInterface(rawui, _parent);
        }
コード例 #3
0
ファイル: MshCommandRuntime.cs プロジェクト: nickchal/pash
 internal MshCommandRuntime(System.Management.Automation.ExecutionContext context, CommandInfo commandInfo, InternalCommand thisCommand)
 {
     this.context = context;
     this.host = context.EngineHostInterface;
     this.CBhost = context.EngineHostInterface;
     this.commandInfo = commandInfo;
     this.thisCommand = thisCommand;
     this.shouldLogPipelineExecutionDetail = this.InitShouldLogPipelineExecutionDetail();
 }
コード例 #4
0
 internal InternalHostRawUserInterface(
     PSHostRawUserInterface externalRawUI,
     InternalHost parentHost)
 {
     using (InternalHostRawUserInterface.tracer.TraceConstructor((object)this))
     {
         InternalHostRawUserInterface.tracer.WriteLine("externalRawUI {0} null", externalRawUI == null ? (object)"is" : (object)"is not");
         this.externalRawUI = externalRawUI;
         this.parentHost    = parentHost;
     }
 }
コード例 #5
0
 internal InternalHostUserInterface(PSHostUserInterface externalUI, InternalHost parentHost)
 {
     this.externalUI = externalUI;
     if (parentHost == null)
     {
         throw PSTraceSource.NewArgumentNullException("parentHost");
     }
     this.parent = parentHost;
     PSHostRawUserInterface externalRawUI = null;
     if (externalUI != null)
     {
         externalRawUI = externalUI.RawUI;
     }
     this.internalRawUI = new InternalHostRawUserInterface(externalRawUI, this.parent);
 }
コード例 #6
0
        internal InternalHostUserInterface(PSHostUserInterface externalUI, InternalHost parentHost)
        {
            this.externalUI = externalUI;
            if (parentHost == null)
            {
                throw PSTraceSource.NewArgumentNullException("parentHost");
            }
            this.parent = parentHost;
            PSHostRawUserInterface externalRawUI = null;

            if (externalUI != null)
            {
                externalRawUI = externalUI.RawUI;
            }
            this.internalRawUI = new InternalHostRawUserInterface(externalRawUI, this.parent);
        }
コード例 #7
0
 internal InternalHostUserInterface(PSHostUserInterface externalUI, InternalHost parentHost)
 {
     using (InternalHostUserInterface.tracer.TraceConstructor((object)this))
     {
         InternalHostUserInterface.tracer.WriteLine("externalUI {0} null", externalUI == null ? (object)"is" : (object)"is not");
         this.externalUI = externalUI;
         this.parent     = parentHost != null ? parentHost : throw InternalHostUserInterface.tracer.NewArgumentNullException(nameof(parentHost));
         PSHostRawUserInterface externalRawUI = (PSHostRawUserInterface)null;
         if (externalUI != null)
         {
             externalRawUI = externalUI.RawUI;
         }
         InternalHostUserInterface.tracer.WriteLine("raw ui {0} null", externalRawUI == null ? (object)"is" : (object)"is not");
         this.internalRawUI = new InternalHostRawUserInterface(externalRawUI, this.parent);
     }
 }
コード例 #8
0
        InternalHostUserInterface(PSHostUserInterface externalUI, InternalHost parentHost)
        {
            // externalUI may be null

            _externalUI = externalUI;

            // parent may not be null, however

            Dbg.Assert(parentHost != null, "parent may not be null");
            if (parentHost == null)
            {
                throw PSTraceSource.NewArgumentNullException("parentHost");
            }
            _parent = parentHost;

            PSHostRawUserInterface rawui = null;

            if (externalUI != null)
            {
                rawui = externalUI.RawUI;
            }

            _internalRawUI = new InternalHostRawUserInterface(rawui, _parent);
        }
コード例 #9
0
 InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     // externalRawUI may be null
     _externalRawUI = externalRawUI;
     _parentHost = parentHost;
 }
コード例 #10
0
 InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     // externalRawUI may be null
     _externalRawUI = externalRawUI;
     _parentHost    = parentHost;
 }
コード例 #11
0
 internal InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     this.externalRawUI = externalRawUI;
     this.parentHost = parentHost;
 }
コード例 #12
0
 internal InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     this.externalRawUI = externalRawUI;
     this.parentHost    = parentHost;
 }
コード例 #13
0
ファイル: MshCommandRuntime.cs プロジェクト: 40a/PowerShell
 internal MshCommandRuntime(ExecutionContext context, CommandInfo commandInfo, InternalCommand thisCommand)
 {
     Context = context;
     Host = context.EngineHostInterface;
     this.CBhost = (InternalHost)context.EngineHostInterface;
     _commandInfo = commandInfo;
     _thisCommand = thisCommand;
     LogPipelineExecutionDetail = InitShouldLogPipelineExecutionDetail();
 }