//actual constructor work, but hidden to not be used accidently in a stupid way private SessionState(SessionStateGlobal sessionStateGlobal, SessionState parent) { SessionStateGlobal = sessionStateGlobal; var parentAliasScope = parent == null ? null : parent._aliasScope; var parentFunctionScope = parent == null ? null : parent._functionScope; var parentVariableScope = parent == null ? null : parent._variableScope; var parentDriveScope = parent == null ? null : parent._driveScope; var parentModuleScope = parent == null ? null : parent._moduleScope; var parentCmdletScope = parent == null ? null : parent._cmdletScope; _aliasScope = new SessionStateScope <AliasInfo>(this, parentAliasScope, SessionStateCategory.Alias); _functionScope = new SessionStateScope <FunctionInfo>(this, parentFunctionScope, SessionStateCategory.Function); _variableScope = new SessionStateScope <PSVariable>(this, parentVariableScope, SessionStateCategory.Variable); _driveScope = new SessionStateScope <PSDriveInfo>(this, parentDriveScope, SessionStateCategory.Drive); _moduleScope = new SessionStateScope <PSModuleInfo>(this, parentModuleScope, SessionStateCategory.Module); _cmdletScope = new SessionStateScope <CmdletInfo>(this, parentCmdletScope, SessionStateCategory.Cmdlet); IsScriptScope = false; Function = new FunctionIntrinsics(_functionScope); Alias = new AliasIntrinsics(_aliasScope); Drive = new DriveManagementIntrinsics(_driveScope); Path = new PathIntrinsics(this); PSVariable = new PSVariableIntrinsics(_variableScope); LoadedModules = new ModuleIntrinsics(_moduleScope); Cmdlet = new CmdletIntrinsics(_cmdletScope); }
// internal internal SessionState(SessionStateGlobal sessionState) { SessionStateGlobal = sessionState; Drive = new DriveManagementIntrinsics(sessionState); Path = new PathIntrinsics(sessionState); Provider = new CmdletProviderManagementIntrinsics(sessionState); PSVariable = new PSVariableIntrinsics(sessionState); }
internal ProviderContext( string requestedPath, ExecutionContext executionContext, PathIntrinsics pathIntrinsics) { this._requestedPath = requestedPath; this._executionContext = executionContext; this._pathIntrinsics = pathIntrinsics; }
public static EntityDrive GetEntityDriveFromPSPath(PathIntrinsics pathIntrinsics, string path) { var paths = pathIntrinsics.GetResolvedPSPathFromPSPath(path); var drive = (from p in paths let e = p.Drive as EntityDrive where null != e select e).Distinct().FirstOrDefault(); return drive; }
/// <summary> /// Create a new instance of ProviderContext. /// </summary> internal ProviderContext( string requestedPath, ExecutionContext executionContext, PathIntrinsics pathIntrinsics) { Dbg.Assert(executionContext != null, "ExecutionContext cannot be null."); _requestedPath = requestedPath; _executionContext = executionContext; _pathIntrinsics = pathIntrinsics; }
/// <summary> /// Create a new instance of ProviderContext. /// </summary> internal ProviderContext( string requestedPath, ExecutionContext executionContext, PathIntrinsics pathIntrinsics) { Dbg.Assert(null != executionContext, "ExecutionContext cannot be null."); _requestedPath = requestedPath; _executionContext = executionContext; _pathIntrinsics = pathIntrinsics; }
//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 CmdletProviderIntrinsicsBase(SessionState sessionState) { SessionState = sessionState; Path = new PathIntrinsics(sessionState); Globber = new PathGlobber(sessionState); }
public PathGlobber(SessionState sessionState) { _sessionState = sessionState; Path = new PathIntrinsics(sessionState); }
internal ProviderContext(string requestedPath, ExecutionContext executionContext, PathIntrinsics pathIntrinsics) { this._requestedPath = requestedPath; this._executionContext = executionContext; this._pathIntrinsics = pathIntrinsics; }
public override string ToString() { return(PathIntrinsics.MakePath(_path, Drive)); }