/// <summary> /// Переименовывание файлов. Используются выделенные файлы /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RenameFile_Click(object sender, RoutedEventArgs e) { if (_LastFocusedLeft) { //Хранилище (чтобы не было конфликтов) ArrayList Selected = new ArrayList(); foreach (var x in LeftFiles.SelectedItems) { Selected.Add(x); } //Собственно - переименовывание foreach (var x in Selected) { FileNameChanger CreateNewFile = new FileNameChanger((x as FileInformation).FileName, PathLeft.Text, ChangeNameMode.RenameFile, (x as FileInformation).FileSize == "Folder"? FileType.Directory : FileType.File); CreateNewFile.ShowDialog(); } } else { ArrayList Selected = new ArrayList(); foreach (var x in RightFiles.SelectedItems) { Selected.Add(x); } foreach (var x in Selected) { FileNameChanger CreateNewFile = new FileNameChanger((x as FileInformation).FileName, PathRight.Text, ChangeNameMode.RenameFile, (x as FileInformation).FileSize == "Folder" ? FileType.Directory : FileType.File); CreateNewFile.ShowDialog(); } } }
/// <summary> /// Call dialog to add new file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddFile_Click(object sender, RoutedEventArgs e) { FileNameChanger CreateNewFile = new FileNameChanger("", _LastFocusedLeft ? PathLeft.Text : PathRight.Text, ChangeNameMode.NewFile, FileType.File); CreateNewFile.ShowDialog(); }