12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Input;
- using Aitex.UI.Charting.View;
- namespace Aitex.UI.Charting.Command
- {
- class ExportAllSeriesCommand : ICommand
- {
- public ExportAllSeriesCommand()
- {
-
- }
- public bool CanExecute(object parameter)
- {
- return true;
- }
- #pragma warning disable 0067
- public event EventHandler CanExecuteChanged;
- #pragma warning restore 0067
- public void Execute(object parameter)
- {
- string seriesId = Guid.NewGuid().ToString();
- Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
- dlg.FileName = seriesId.Replace("/", "_").Replace(":", "_").Replace(" ", "_"); // Default file name
- dlg.DefaultExt = ".csv"; // Default file extension
- dlg.Filter = "Excel (.csv)|*.csv"; // Filter files by extension
- // Show open file dialog box
- Nullable<bool> result = dlg.ShowDialog();
- if (result.HasValue && result.Value)
- {
- DataSeriesExportingAll processDialog = new DataSeriesExportingAll(dlg.FileName) { Owner = Application.Current.MainWindow };
- processDialog.Show();
- }
- }
- }
- }
|