Exemplo n.º 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);
 }
        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);
        }
Exemplo n.º 3
0
 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();
 }
 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;
     }
 }
Exemplo n.º 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);
 }
        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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
 InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     // externalRawUI may be null
     _externalRawUI = externalRawUI;
     _parentHost = parentHost;
 }
Exemplo n.º 10
0
 InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     // externalRawUI may be null
     _externalRawUI = externalRawUI;
     _parentHost    = parentHost;
 }
Exemplo n.º 11
0
 internal InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     this.externalRawUI = externalRawUI;
     this.parentHost = parentHost;
 }
 internal InternalHostRawUserInterface(PSHostRawUserInterface externalRawUI, InternalHost parentHost)
 {
     this.externalRawUI = externalRawUI;
     this.parentHost    = parentHost;
 }
Exemplo n.º 13
0
 internal MshCommandRuntime(ExecutionContext context, CommandInfo commandInfo, InternalCommand thisCommand)
 {
     Context = context;
     Host = context.EngineHostInterface;
     this.CBhost = (InternalHost)context.EngineHostInterface;
     _commandInfo = commandInfo;
     _thisCommand = thisCommand;
     LogPipelineExecutionDetail = InitShouldLogPipelineExecutionDetail();
 }