示例#1
0
 public IOController(ListView listView)
 {
     this.listView = listView;
     workDir       = new Directory(0, "root");
     EntryCmd.getInstance().newOpe(workDir);
     listItems();
 }
示例#2
0
 public void redo()
 {
     if (UndoManager.getInstance().CanRedo())
     {
         UndoManager.getInstance().redo();
         EntryCmd.getInstance().redo();
         workDir = (Directory)EntryCmd.getInstance().tempDir.Clone();
         listItems();
         MemoryInterface.getInstance().write();
     }
 }
示例#3
0
 public void forward()
 {
     if (backDir.Count == 0)
     {
         return;
     }
     UndoManager.getInstance().die();
     frontDir.Insert(0, workDir);
     workDir = backDir[0];
     backDir.RemoveAt(0);
     EntryCmd.getInstance().die();
     EntryCmd.getInstance().newOpe(workDir);
     listItems();
 }
示例#4
0
        public Boolean createEntry(string type, string _name)        //创建新的文件
        {
            string name = workDir.createEntry(_name, type);

            if (name == null)
            {
                return(false);
            }

            if (_name == null)
            {
                setViewItem(name, type, 0, DateTime.Now);
            }
            EntryCmd.getInstance().newOpe(workDir);
            return(true);
        }
示例#5
0
        public Boolean reDirectCatalog(int selected)     //切换文件目录或打开文件
        {
            Entry temp = ((List <Entry>)workDir.getContent()).ElementAt <Entry>(selected);

            if (temp.GetType().Name.Equals("File"))        //是文件直接打开
            {
                selectedItem = (File)temp;
                return(true);
            }
            else
            {
                EntryCmd.getInstance().die();
                frontDir.Insert(0, workDir);
                workDir = (Directory)temp;
            }

            listItems();     //是文件夹进入目录
            return(false);
        }
示例#6
0
 public void removeEntry(string name, int index)
 {
     listView.Items.RemoveAt(index);
     workDir.removeEntry(index, name);
     EntryCmd.getInstance().newOpe(workDir);
 }
示例#7
0
 public void reNameEntry(string newName, int _index)       //重命名文件
 {
     workDir.reNameEntry(newName, _index);
     EntryCmd.getInstance().newOpe(workDir);
 }