public IEnumerator <string> GetEnumerator() { ShellItem folder = new ShellItem((Environment.SpecialFolder)CSIDL.NETWORK); IEnumerator <ShellItem> e = folder.GetEnumerator(SHCONTF.FOLDERS); while (e.MoveNext()) { yield return(e.Current.ParsingName); } }
/// <summary> /// Loads all the available Pervasive connections /// </summary> public PsqlServerContext() { //loads all computers on network as pervasive engine pcc.exe connects to computer name instead of ip ShellItem folder = new ShellItem((Environment.SpecialFolder)CSIDL.NETWORK); IEnumerator <ShellItem> e = folder.GetEnumerator(SHCONTF.FOLDERS); ServerInstances = new List <IServerInstance>(); while (e.MoveNext()) { //TODO:add testing to see if valid pervasive engine is running on target network computer by trying to connect first ServerInstances.Add(new PsqlServerInstance(e.Current.DisplayName)); } }
IEnumerator<ShellItem> GetFolderEnumerator(ShellItem folder) { SHCONTF filter = SHCONTF.FOLDERS; if (ShouldShowHidden()) filter |= SHCONTF.INCLUDEHIDDEN; return folder.GetEnumerator(filter); }
void CreateItems(ShellItem folder, int indent) { IEnumerator<ShellItem> e = folder.GetEnumerator( SHCONTF.FOLDERS | SHCONTF.INCLUDEHIDDEN); while (e.MoveNext()) { if (ShouldCreateItem(e.Current)) { CreateItem(e.Current, indent); } } }