Exemplo n.º 1
0
        /// <summary>
        ///  Execute the merge command.
        /// </summary>
        /// <param name="parameter">The command parameter (ignored).</param>
        private async Task MergeExecute(object parameter)
        {
            OutputPath = BrowseFile.Save(
                Resources.MainWindowStrings.SetOutput,
                Resources.MainWindowStrings.FileFilter,
                Application.Current.MainWindow);

            if (string.IsNullOrWhiteSpace(OutputPath))
            {
                return;
            }

            if (merger.CanMerge)
            {
                IsProcessing = true;
                await merger.MergeAsync().ConfigureAwait(false);

                IsProcessing = false;
                OpenPdfFromShell();
            }
            else
            {
                MessageBox.Show(Resources.MainWindowStrings.CouldNotMerge);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Load a saved window state.
        /// </summary>
        public void Open()
        {
            var paths = BrowseFile.Open(
                Resources.MainWindowStrings.Open,
                Resources.MainWindowStrings.ProjectFilter,
                Application.Current.MainWindow);

            if (paths.Any(p => !string.IsNullOrWhiteSpace(p)))
            {
                LoadStateFromFile(paths.First(p => !string.IsNullOrWhiteSpace(p)));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///  Execute the browse input command.
        /// </summary>
        /// <param name="parameter">The command parameter (ignored).</param>
        private void BrowseInputExecute(object parameter)
        {
            var paths = BrowseFile.Open(
                Resources.MainWindowStrings.AddInput,
                Resources.MainWindowStrings.FileFilter,
                Application.Current.MainWindow);

            if (paths.Any())
            {
                AddPaths(paths);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///  Save the state of the window.
        /// </summary>
        public void Save()
        {
            var path = BrowseFile.Save(
                Resources.MainWindowStrings.Save,
                Resources.MainWindowStrings.ProjectFilter,
                Application.Current.MainWindow);

            if (!string.IsNullOrWhiteSpace(path))
            {
                SaveStateToFile(path);
            }
        }