//
        public void stick_click()
        {
            if (CategoryManage.IsCut)
            {
                //删除
                CategoryManage.delete(CategoryManage.Create, CategoryManage.cut_file.Path);

                CategoryManage.cut_file.Path = CategoryManage.CurrentFile.Path + "/" + CategoryManage.cut_file.Name;
                CategoryManage.cut_file.Date = DateTime.Now.ToString();
                CategoryManage.listFiles.Add(CategoryManage.cut_file);
                CategoryManage.IsCut = false;
                CategoryManage.Update();
            }
            else if (CategoryManage.IsCopy)
            {
                //复制
                if (CategoryManage.copy_file != null)
                {
                    string str   = DiskManage.getStrContent(CategoryManage.copy_file.Disk_start, CategoryManage.copy_file.Size);
                    int    size  = 0;
                    int    start = DiskManage.saveContent(str, ref size);
                    CategoryManage.copy_file.Disk_start = start;
                    CategoryManage.copy_file.Size       = size;
                    CategoryManage.copy_file.Date       = DateTime.Now.ToString();

                    CategoryManage.listFiles.Add(CategoryManage.copy_file);
                    CategoryManage.Update();
                }
            }

            this.DialogResult = true;
        }
        //粘贴
        private void Click_Stick(object sender, RoutedEventArgs e)
        {
            //剪切
            if (CategoryManage.IsCut)
            {
                //删除
                CategoryManage.delete(CategoryManage.Create, CategoryManage.cut_file.Path);
                CategoryManage.cut_file.Path = CategoryManage.CurrentFile.Path + "/" + CategoryManage.cut_file.Name;
                CategoryManage.cut_file.Date = DateTime.Now.ToString();
                CategoryManage.listFiles.Add(CategoryManage.cut_file);
                CategoryManage.IsCut = false;
                CategoryManage.Update();
            }
            //复制
            else if (CategoryManage.IsCopy)
            {
                if (CategoryManage.copy_file != null)
                {
                    string str   = DiskManage.getStrContent(CategoryManage.copy_file.Disk_start, CategoryManage.copy_file.Size);
                    int    size  = 0;
                    int    start = DiskManage.saveContent(str, ref size);
                    CategoryManage.copy_file.Disk_start = start;
                    CategoryManage.copy_file.Size       = size;

                    CategoryManage.copy_file.Path = CategoryManage.CurrentFile.Path + "/" + CategoryManage.copy_file.Name;
                    CategoryManage.copy_file.Date = DateTime.Now.ToString();

                    CategoryManage.listFiles.Add(CategoryManage.copy_file);
                    CategoryManage.Update();
                }
            }
        }
Esempio n. 3
0
 public EditWindow()
 {
     InitializeComponent();
     text_content.Text = DiskManage.getStrContent(CategoryManage.selectedFile.Disk_start, CategoryManage.selectedFile.Size);
 }