private IEnumerable<string> ExpandFileSystem(Control control, string text)
 {
     int num = text.LastIndexOfAny(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar });
     string b = (num >= 0) ? text.Substring(0, num + 1) : string.Empty;
     if (!string.Equals(this.LastFileSystemSource, b, StringComparison.OrdinalIgnoreCase))
     {
         this.LastFileSystemSource = b;
         try
         {
             this.LastFileSystemCollection = null;
             string str2 = this.UseEnvironmentVariablesSource ? Environment.ExpandEnvironmentVariables(b) : b;
             if (!string.IsNullOrEmpty(str2))
             {
                 GetCurrentDirectoryEventArgs e = new GetCurrentDirectoryEventArgs(control, this.CurrentDir);
                 this.OnGetCurrentDirectory(e);
                 if (!string.IsNullOrEmpty(e.CurrentDirectory))
                 {
                     System.IO.Directory.SetCurrentDirectory(e.CurrentDirectory);
                     this.LastFileSystemCollection = new List<string>();
                 }
                 else if (Path.IsPathRooted(str2))
                 {
                     this.LastFileSystemCollection = new List<string>();
                 }
             }
             if (this.LastFileSystemCollection != null)
             {
                 PreviewFileSystemInfoEventArgs args2 = null;
                 foreach (FileSystemInfo info in Microsoft.IO.Directory.GetFileSystemInfos(str2))
                 {
                     PreviewFileSystemInfoEventArgs args3 = args2 ?? (args2 = new PreviewFileSystemInfoEventArgs(control));
                     args3._Value = info;
                     args3.Cancel = false;
                     this.OnPreviewFileSystemInfo(args3);
                     if (!args3.Cancel)
                     {
                         this.LastFileSystemCollection.Add(b + info.Name);
                     }
                 }
                 this.LastFileSystemCollection.TrimExcess();
             }
         }
         catch
         {
             this.LastFileSystemCollection = null;
         }
     }
     if (((text.Length > 0) && (this.LastFileSystemCollection != null)) && (this.LastFileSystemCollection.Count > 0))
     {
         return this.LastFileSystemCollection.Where<string>(delegate (string x) {
             return x.StartsWith(text, StringComparison.OrdinalIgnoreCase);
         });
     }
     return new string[0];
 }
 protected virtual void OnGetCurrentDirectory(GetCurrentDirectoryEventArgs e)
 {
     EventHandler<GetCurrentDirectoryEventArgs> handler = base.Events[EventGetCurrentDirectory] as EventHandler<GetCurrentDirectoryEventArgs>;
     if (handler != null)
     {
         handler(this, e);
     }
 }
 private static void GetCurrentDirectory(object sender, GetCurrentDirectoryEventArgs e)
 {
     VirtualPathBreadcrumb parent = e.Target.Parent as VirtualPathBreadcrumb;
     if (parent != null)
     {
         CustomFileSystemFolder currentFolder = parent.CurrentFolder as CustomFileSystemFolder;
         if (currentFolder != null)
         {
             e.CurrentDirectory = currentFolder.FullName;
         }
     }
 }