public ExecutionContext(PSHost host, RunspaceConfiguration config) : this() { RunspaceConfiguration = config; LocalHost = host; SessionStateGlobal = new SessionStateGlobal(this); SessionState = new SessionState(SessionStateGlobal); }
// internal internal SessionState(SessionStateGlobal sessionState) { SessionStateGlobal = sessionState; Drive = new DriveManagementIntrinsics(sessionState); Path = new PathIntrinsics(sessionState); Provider = new CmdletProviderManagementIntrinsics(sessionState); PSVariable = new PSVariableIntrinsics(sessionState); }
private ExecutionContext() { // TODO: create a "Global Session state" if (_sessionStateGlobal == null) _sessionStateGlobal = new SessionStateGlobal(this); // TODO: initialize all the default settings _pipelineStack = new Stack<Pipeline>(); _variables = new Dictionary<string, PSVariable>(StringComparer.CurrentCultureIgnoreCase); SessionState = new SessionState(_sessionStateGlobal); }
private ExecutionContext() { // TODO: create a "Global Session state" if (_sessionStateGlobal == null) { _sessionStateGlobal = new SessionStateGlobal(this); } // TODO: initialize all the default settings _pipelineStack = new Stack <Pipeline>(); _variables = new Dictionary <string, PSVariable>(StringComparer.CurrentCultureIgnoreCase); SessionState = new SessionState(_sessionStateGlobal); }
//actual constructor work, but hidden to not be used accidently in a stupid way private SessionState(SessionStateGlobal sessionStateGlobal, SessionStateScope<FunctionInfo> functions, SessionStateScope<PSVariable> variables, SessionStateScope<PSDriveInfo> drives, SessionStateScope<AliasInfo> aliases) { SessionStateGlobal = sessionStateGlobal; _aliasScope = new SessionStateScope<AliasInfo>(aliases, SessionStateCategory.Alias); _functionScope = new SessionStateScope<FunctionInfo>(functions, SessionStateCategory.Function); _variableScope = new SessionStateScope<PSVariable>(variables, SessionStateCategory.Variable); _driveScope = new SessionStateScope<PSDriveInfo>(drives, SessionStateCategory.Drive); IsScriptScope = false; Function = new FunctionIntrinsics(this, _functionScope); Alias = new AliasIntrinsics(this, _aliasScope); Drive = new DriveManagementIntrinsics(this, _driveScope); Path = new PathIntrinsics(SessionStateGlobal); Provider = new CmdletProviderManagementIntrinsics(SessionStateGlobal); PSVariable = new PSVariableIntrinsics(this, _variableScope); }
// creates a session state with a new (glovbal) scope internal SessionState(SessionStateGlobal sessionStateGlobal) : this(sessionStateGlobal, null, null, null, null) { defaultInit(); }
internal CmdletProviderManagementIntrinsics(SessionStateGlobal sessionState) { _sessionState = sessionState; }
internal DriveManagementIntrinsics(SessionStateGlobal sessionState) { _sessionState = sessionState; }
internal PSVariableIntrinsics(SessionStateGlobal sessionState) { _sessionState = sessionState; }
internal PathIntrinsics(SessionStateGlobal sessionState) { _sessionState = sessionState; }
internal CmdletProviderManagementIntrinsics(SessionStateGlobal sessionState) { _sessionState = sessionState; _providers = new Dictionary<string, List<ProviderInfo>>(StringComparer.CurrentCultureIgnoreCase); _providerInstances = new Dictionary<ProviderInfo, CmdletProvider>(); }
internal PathIntrinsics(SessionState sessionState) { _sessionState = sessionState; _sessionStateGlobal = sessionState.SessionStateGlobal; }
// creates a session state with a new (glovbal) scope internal SessionState(SessionStateGlobal sessionStateGlobal) : this(sessionStateGlobal, null, null, null, null) { }