Example #1
0
        /// <summary>
        /// Constructor for ServerRemoteHost.
        /// </summary>
        internal ServerRemoteHost(
            Guid clientRunspacePoolId,
            Guid clientPowerShellId,
            HostInfo hostInfo,
            AbstractServerTransportManager transportManager,
            Runspace runspace,
            ServerDriverRemoteHost serverDriverRemoteHost)
        {
            _clientRunspacePoolId = clientRunspacePoolId;
            _clientPowerShellId = clientPowerShellId;
            Dbg.Assert(hostInfo != null, "Expected hostInfo != null");
            Dbg.Assert(transportManager != null, "Expected transportManager != null");

            // Set host-info and the transport-manager.
            HostInfo = hostInfo;
            _transportManager = transportManager;
            _serverDriverRemoteHost = serverDriverRemoteHost;

            // Create the executor for the host methods.
            _serverMethodExecutor = new ServerMethodExecutor(
                clientRunspacePoolId, clientPowerShellId, _transportManager);

            // Use HostInfo to create host-UI as null or non-null based on the client's host-UI.
            _remoteHostUserInterface = hostInfo.IsHostUINull ? null : new ServerRemoteHostUserInterface(this);

            Runspace = runspace;
        }
        internal ServerRemoteHostUserInterface(System.Management.Automation.Remoting.ServerRemoteHost remoteHost)
        {
            this._remoteHost = remoteHost;
            this._serverMethodExecutor = remoteHost.ServerMethodExecutor;
            this._rawUI = remoteHost.HostInfo.IsHostRawUINull ? null : new ServerRemoteHostRawUserInterface(this);
			AddHostDefaultData();
        }
        /// <summary>
        /// Constructor for ServerRemoteHostRawUserInterface.
        /// </summary>
        internal ServerRemoteHostRawUserInterface(ServerRemoteHostUserInterface remoteHostUserInterface)
        {
            Dbg.Assert(remoteHostUserInterface != null, "Expected remoteHostUserInterface != null");
            _remoteHostUserInterface = remoteHostUserInterface;
            Dbg.Assert(!remoteHostUserInterface.ServerRemoteHost.HostInfo.IsHostRawUINull, "Expected !remoteHostUserInterface.ServerRemoteHost.HostInfo.IsHostRawUINull");

            _serverMethodExecutor = remoteHostUserInterface.ServerRemoteHost.ServerMethodExecutor;
        }
        /// <summary>
        /// Constructor for ServerRemoteHostUserInterface.
        /// </summary>
        internal ServerRemoteHostUserInterface(ServerRemoteHost remoteHost)
        {
            Dbg.Assert(remoteHost != null, "Expected remoteHost != null");
            ServerRemoteHost = remoteHost;
            Dbg.Assert(!remoteHost.HostInfo.IsHostUINull, "Expected !remoteHost.HostInfo.IsHostUINull");

            _serverMethodExecutor = remoteHost.ServerMethodExecutor;

            // Use HostInfo to duplicate host-RawUI as null or non-null based on the client's host-RawUI.
            RawUI = remoteHost.HostInfo.IsHostRawUINull ? null : new ServerRemoteHostRawUserInterface(this);
        }
 internal ServerRemoteHostRawUserInterface(ServerRemoteHostUserInterface remoteHostUserInterface)
 {
     this._remoteHostUserInterface = remoteHostUserInterface;
     this._serverMethodExecutor = remoteHostUserInterface.ServerRemoteHost.ServerMethodExecutor;
 }