// internal internal SessionState(SessionStateGlobal sessionState) { SessionStateGlobal = sessionState; Drive = new DriveManagementIntrinsics(sessionState); Path = new PathIntrinsics(sessionState); Provider = new CmdletProviderManagementIntrinsics(sessionState); PSVariable = new PSVariableIntrinsics(sessionState); }
//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); }
//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); }
internal SessionStateGlobal(ExecutionContext executionContext) { _globalExecutionContext = executionContext; _snapins = new Dictionary<string, PSSnapInInfo>(StringComparer.CurrentCultureIgnoreCase); Provider = new CmdletProviderManagementIntrinsics(this); }