public void Move(CodeFile file) { var window = new OpenFolderWindow(System.IO.Path.GetDirectoryName(file.Path)); bool?result = window.ShowDialog(); if (result.HasValue && result.Value) { // Сохраняем исходный file.Save(); try { // Перемещение file.Move(System.IO.Path.Combine(window.Path, file.Name)); CodeProjectManager.Instance.SaveCurrent(); } catch (FileMoveException ex) { ErrorWindow err = new ErrorWindow { ShortDesc = LocalString.Get("Error_MoveFile_short"), FullDesc = LocalString.Get("Error_MoveFile_full"), Exception = ex }; err.ShowDialog(); } } }
private void buttonBrowse_Click(object sender, RoutedEventArgs e) { var window = new OpenFolderWindow(comboBox2.Text) { Owner = this }; bool?result = window.ShowDialog(); if (result.HasValue && result.Value) { comboBox2.Text = window.Path; } }
private void Button3_Click(object sender, RoutedEventArgs e) { // Add new folder var window = new OpenFolderWindow() { Owner = _parent }; bool?result = window.ShowDialog(); if (result.HasValue && result.Value) { BindingCollection.Add(window.Path); } if (listView1.Items.Count <= 1) { DelButton.IsEnabled = false; } else { DelButton.IsEnabled = true; } }