Esempio n. 1
0
        public void save_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            int size = 0;

            DiskManage.deleteFile(CategoryManage.selectedFile.Disk_start);  //删除原本磁盘
            int start = DiskManage.saveContent(text_content.Text, ref size);

            CategoryManage.selectedFile.Disk_start       = start;
            CategoryManage.selectedFile.Size             = size;
            CategoryManage.selectedFile.Occupation_space = (int)Math.Ceiling(Convert.ToDouble(size / 512.0)) * 512;
            CategoryManage.selectedFile.Date             = DateTime.Now.ToString();
            CategoryManage.Update();
        }
Esempio n. 2
0
 //删除
 public static void delete(File file, string path)
 {
     if (file != null && file.SubFiles != null)
     {
         for (int index = 0; index < file.SubFiles.Count(); index++)
         {
             if (file.SubFiles[index].Path.Equals(path))
             {
                 DiskManage.deleteFile(file.SubFiles[index].Disk_start);
                 file.SubFiles.Remove(file.SubFiles[index]);
             }
             else
             {
                 delete(file.SubFiles[index], path);
             }
         }
     }
 }