private void ExportGraphML_Click(object sender, RoutedEventArgs e) { try { string directory = m_SettingService.PlanDirectory; var filter = new FileDialogFileTypeFilter( Resource.ProjectPlan.Filters.SaveGraphMLFileType, Resource.ProjectPlan.Filters.SaveGraphMLFileExtension ); bool result = m_FileDialogService.ShowSaveDialog(directory, filter); if (result) { { string filename = m_FileDialogService.Filename; if (string.IsNullOrWhiteSpace(filename)) { MessageBox.Show( Resource.ProjectPlan.Resources.Message_EmptyFilename, Resource.ProjectPlan.Resources.Title_Error, MessageBoxButton.OKCancel, MessageBoxImage.Error); } else { File.WriteAllBytes( filename, ViewModel.ExportArrowGraphToDiagram( ArrowGraphAreaCtrl.ToDiagramArrowGraph())); m_SettingService.SetDirectory(filename); } } } } catch (Exception ex) { System.Windows.MessageBox.Show( ex.Message, Resource.ProjectPlan.Resources.Title_Error, MessageBoxButton.OKCancel, MessageBoxImage.Error); } }
private void ExportGraphML_Click(object sender, RoutedEventArgs e) { try { string directory = m_AppSettingService.ProjectPlanFolder; if (m_FileDialogService.ShowSaveDialog( directory, Properties.Resources.Filter_SaveGraphMLFileType, Properties.Resources.Filter_SaveGraphMLFileExtension) == DialogResult.OK) { { string filename = m_FileDialogService.Filename; if (string.IsNullOrWhiteSpace(filename)) { System.Windows.MessageBox.Show( Properties.Resources.Message_EmptyFilename, Properties.Resources.Title_Error, MessageBoxButton.OKCancel, MessageBoxImage.Error); } else { File.WriteAllBytes( filename, ViewModel.ExportArrowGraphToDiagram( ArrowGraphAreaCtrl.ToDiagramArrowGraphDto())); m_AppSettingService.ProjectPlanFolder = Path.GetDirectoryName(filename); } } } } catch (Exception ex) { System.Windows.MessageBox.Show( ex.Message, Properties.Resources.Title_Error, MessageBoxButton.OKCancel, MessageBoxImage.Error); } }