예제 #1
0
        /// <summary>
        /// Handles the Click event of the ProceedButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void ProceedButton_Click(object sender, RoutedEventArgs e)
        {
            if (SourceTextBox.Text.Any() && DestinationTextBox.Text.Any() && Directory.Exists(System.IO.Path.GetDirectoryName(DestinationTextBox.Text)) && File.Exists(SourceTextBox.Text))
            {
                this.NavigationService.Navigate(new ExtractProcess(new ExtractConfig()
                {
                    SourceFilePath      = SourceTextBox.Text,
                    DestinationFilePath = DestinationTextBox.Text
                }));

                RecentFileManager.AddRecentFile(new RecentFile()
                {
                    OperationType       = "/assets/images/extract.png",
                    Name                = System.IO.Path.GetFileNameWithoutExtension(SourceTextBox.Text),
                    SourceFilePath      = System.IO.Path.GetDirectoryName(SourceTextBox.Text),
                    DestinationFilePath = DestinationTextBox.Text
                });
            }
            else
            {
                MessageBox.Show(Application.Current.MainWindow,
                                "An error prohibited the loading of the files. Either the source file or the destination path does not exist. \n\nKindly check on your input file and destination path.",
                                "Selecting files");
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the Click event of the ProceedButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void ProceedButton_Click(object sender, RoutedEventArgs e)
        {
            if (SourceTextBox.Text.Any() && File.Exists(SourceTextBox.Text))
            {
                this.NavigationService.Navigate(new ViewList(SourceTextBox.Text));

                RecentFileManager.AddRecentFile(new RecentFile()
                {
                    OperationType  = "/assets/images/view.png",
                    Name           = System.IO.Path.GetFileNameWithoutExtension(SourceTextBox.Text),
                    SourceFilePath = System.IO.Path.GetDirectoryName(SourceTextBox.Text),
                });
            }
            else
            {
                MessageBox.Show(Application.Current.MainWindow,
                                "An error prohibited the loading of the file. The source file does not exist. \n\nKindly check on your input file.",
                                "Selecting file");
            }
        }