private void _menuItemProjectSaveAs_Click(object sender, RoutedEventArgs e) { try { string file = PathRequest.SaveFileCde( "filter", FileFormat.MergeFilters(Format.Sde), "fileName", Path.GetFileName(ProjectConfiguration.ConfigAsker.ConfigFile)); if (file != null) { if (file == ProjectConfiguration.ConfigAsker.ConfigFile) { } else { try { GrfPath.Delete(file); File.Copy(ProjectConfiguration.ConfigAsker.ConfigFile, file); } catch (Exception err) { ErrorHandler.HandleException(err); return; } _recentFilesManager.AddRecentFile(file); ReloadSettings(file); } } } catch (Exception err) { ErrorHandler.HandleException(err.Message, ErrorLevel.Warning); } }
private void _menuItemProjectLoadAs_Click(object sender, RoutedEventArgs e) { try { string file = PathRequest.OpenFileCde("filter", FileFormat.MergeFilters(Format.Sde)); if (file != null) { if (File.Exists(file)) { _recentFilesManager.AddRecentFile(file); ReloadSettings(file); } } } catch (Exception err) { ErrorHandler.HandleException(err.Message, ErrorLevel.Warning); } }
public static void ReplaceFields <TKey>(GDbTabWrapper <TKey, ReadableTuple <TKey> > tab) { try { string[] files = PathRequest.OpenFilesCde("filter", FileFormat.MergeFilters(Format.All, Format.Txt, Format.Lua)); if (files == null || files.Length == 0) { return; } foreach (var file in files) { _readFile(file, tab); } } catch (OperationCanceledException) { } catch (Exception err) { ErrorHandler.HandleException(err); } }