//新建文件夹 private void Click_NewFolder(object sender, RoutedEventArgs e) { File file = new File(); string name = "未命名_" + CategoryManage.findCategory(); file.Name = name; file.Disk_start = -1; file.Path = CategoryManage.CurrentFile.Path + "/" + name; file.Date = DateTime.Now.ToString(); file.Size = 0; file.Type = "Folder"; CategoryManage.listFiles.Add(file); CategoryManage.Update(); }
// public void new_file_click() { if (CategoryManage.CurrentFile.Type.Equals("Folder")) { File file = new File(); string name = "未命名_" + CategoryManage.findCategory(); file.Name = name; file.Path = CategoryManage.CurrentFile.Path + "/" + name; file.Date = DateTime.Now.ToString(); file.Disk_start = -1; file.Size = 0; file.Type = "File"; CategoryManage.listFiles.Add(file); CategoryManage.Update(); } this.DialogResult = true; }