Пример #1
0
        static void ExportScreenshot()
        {
            ScreenshotExporterViewModel vm = new ScreenshotExporterViewModel();

            if (vm.ExportSelectionCommand.CanExecute(null))
            {
                vm.ChooseFileNameMessage.Sent += (sender, args) =>
                {
                    try
                    {
                        Logger.Info("Choose file name message was received");
                        ChooseFileSaveAction a = new ChooseFileSaveAction();
                        a.Invoke(args);
                    }
                    catch (Excel.CopyException)
                    {
                        NotificationAction a = new NotificationAction();
                        a.Caption = Strings.ScreenshotExport;
                        a.Message = Strings.GraphicHasNoCopyMethod;
                        a.Invoke();
                    }
                };
                vm.ExportSelectionCommand.Execute(null);
            }
            else
            {
                NotificationAction a = new NotificationAction();
                a.Caption = Strings.ScreenshotExport;
                a.Message = Strings.ScreenshotExportRequiresGraphic;
                a.Invoke();
            }
        }
Пример #2
0
 static void SaveCsv(Xl.Range range)
 {
     Csv.CsvExportViewModel vm = CreateCsvExportViewModel(range);
     vm.ChooseExportFileNameMessage.Sent += (sender, args) =>
     {
         ChooseFileSaveAction a = new ChooseFileSaveAction();
         a.Invoke(args);
     };
     vm.ChooseFileNameCommand.Execute(null);
 }
Пример #3
0
        void ChooseFileNameMessage_Sent(object sender, MessageArgs <FileNameMessageContent> e)
        {
            ChooseFileSaveAction action = new ChooseFileSaveAction();

            action.Invoke(e);
        }