Ejemplo n.º 1
0
        /// <summary>
        /// Reloads the file content view.
        /// You can optionally pass if you want to add the current navigated path to the stack.
        /// </summary>
        public void Reload(string path, bool addToStack)
        {
            try {
                List <GBase> files   = SystemCalls.returnFiles(path);
                List <GBase> folders = SystemCalls.returnFolders(path);
                if (addToStack && !(stack.Exists((String str) => { return(str.Equals(path)); })))
                {
                    stack.Add(path);
                }
                controller.getUI.UpdatePathField(path);
                CurrentSelectedFile = null;
                Clear((item) => { components.Remove(item.GetComponent <GComponent>()); });
                switch (GFileBrowser.FileOrder)
                {
                case GFileBrowser.Order.FirstFiles:
                    inst(files, addToComponents);
                    inst(folders, addToComponents);
                    break;

                case GFileBrowser.Order.FirstFolders:
                    inst(folders, addToComponents);
                    inst(files, addToComponents);
                    break;
                }
                recalculateContentSize(files.Count + folders.Count);
            } catch (Exception e) {
                controller.getUI.DisplayError(e);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Reloads the drive view contents.
 /// </summary>
 public override void Reload()
 {
     try {
         List <GBase> drives = SystemCalls.returnDrives();
         Clear();
         inst(drives, (b, go) => {
             go.GetComponent <GComponent>().Load(b);
             go.GetComponent <UIClickListener>().AddDownListener(UIClickListener.Type.LeftClick, () => {
                 controller.getUI.onDriveClicked(go.GetComponent <GComponent>());
             });
         });
         recalculateContentSize(drives.Count);
     } catch (Exception e) {
         controller.getUI.DisplayError(e);
     }
 }