public IOController(ListView listView) { this.listView = listView; workDir = new Directory(0, "root"); EntryCmd.getInstance().newOpe(workDir); listItems(); }
public void redo() { if (UndoManager.getInstance().CanRedo()) { UndoManager.getInstance().redo(); EntryCmd.getInstance().redo(); workDir = (Directory)EntryCmd.getInstance().tempDir.Clone(); listItems(); MemoryInterface.getInstance().write(); } }
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(); }
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); }
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); }
public void removeEntry(string name, int index) { listView.Items.RemoveAt(index); workDir.removeEntry(index, name); EntryCmd.getInstance().newOpe(workDir); }
public void reNameEntry(string newName, int _index) //重命名文件 { workDir.reNameEntry(newName, _index); EntryCmd.getInstance().newOpe(workDir); }