private ContextCookie EnterContext(string path) { ContextCookie cookie = new ContextCookie(_rootInfo, EnterContext()); if (PSDriveInfo == null && !string.IsNullOrEmpty(path)) { _rootInfo = ParsePSPathRoot(path); } return(cookie); }
internal DirectoryServiceDriveInfo ( String name, ProviderInfo provider, String description, PSCredential credential, DirectoryRootInfo rootInfo ) : base(name, provider, name + ':', description, credential) { _rootInfo = rootInfo; }
private void ParsePSPath(string path, out DirectoryRootInfo root, out string childPath) { foreach (DirectoryServiceDriveInfo drive in ProviderInfo.Drives) { if (path.StartsWith(drive.Root, StringComparison.OrdinalIgnoreCase)) { root = drive.RootInfo; childPath = path.Substring(drive.Root.Length); childPath = childPath.Trim(Slash, Backslash); return; } } string protocol = DSProtocol.GetProtocol(ref path); string server = null; ushort port = DSProtocol.DefaultPort; int slash = path.IndexOfAny(new char[] { Slash, Backslash }); if (slash > -1) { server = path.Substring(0, slash); path = path.Substring(slash + 1); int colon = server.IndexOf(':'); if (colon > -1) { port = ushort.Parse(server.Substring(colon + 1)); server = server.Substring(0, colon); } } slash = path.IndexOfAny(new char[] { Slash, Backslash }); if (slash < 0) { slash = path.Length; } Utils.SplitString(path, slash, out path, out childPath); root = new DirectoryRootInfo(protocol, server, port, LdapPath.Parse(path)); }
internal ContextCookie(DirectoryRootInfo prev, PscxThreadContext.Cookie? providerCookie) { _prev = prev; _providerCookie = providerCookie; }
internal ContextCookie(DirectoryRootInfo prev) : this(prev, null) { }
private ContextCookie EnterContext(string path) { ContextCookie cookie = new ContextCookie(_rootInfo, EnterContext()); if (PSDriveInfo == null && !string.IsNullOrEmpty(path)) { _rootInfo = ParsePSPathRoot(path); } return cookie; }
private PSDriveInfo CreateDrive(string name, string description, PSCredential credential, DirectoryRootInfo rootInfo) { return new DirectoryServiceDriveInfo(name, ProviderInfo, description, credential, rootInfo); }
private PSDriveInfo CreateDrive(PSDriveInfo drive, DirectoryRootInfo rootInfo) { return CreateDrive(drive.Name, drive.Description, drive.Credential, rootInfo); }
internal ContextCookie(DirectoryRootInfo prev, PscxThreadContext.Cookie?providerCookie) { _prev = prev; _providerCookie = providerCookie; }
private PSDriveInfo CreateDrive(string name, string description, PSCredential credential, DirectoryRootInfo rootInfo) { return(new DirectoryServiceDriveInfo(name, ProviderInfo, description, credential, rootInfo)); }
private PSDriveInfo CreateDrive(PSDriveInfo drive, DirectoryRootInfo rootInfo) { return(CreateDrive(drive.Name, drive.Description, drive.Credential, rootInfo)); }