Example #1
0
 /// <summary>
 /// Opens window to enter number of rows
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OpenRowNumberWindow(object sender, RoutedEventArgs e)
 {
     numberWindow = new RowsNumberWindow();
     numberWindow.Show();
     numberWindow.BringIntoView();
     numberWindow.SelectRowsButton.Click += SelectRowsButton_Click;
 }
Example #2
0
        /// <summary>
        /// Open file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openFileDialog_FileOk(object sender, CancelEventArgs e)
        {
            fileService            = new FileService();
            dialogService.FilePath = dialogService.OpenDialog.FileName;
            try
            {
                DataTable table = fileService.OpenExcelAsDataTable(dialogService.FilePath);
                tableManager = new TableManager(table);

                numberWindow = new RowsNumberWindow();
                numberWindow.SelectRowsButton.Click += SelectRowsButton_Click;
                numberWindow.Show();
                numberWindow.BringIntoView();
            }
            catch (Exception ex) when(ex is FileServiceException ||
                                      ex is TableValidationException ||
                                      ex is TableParseException)
            {
                MessageBox.Show($"{ex.Message}\n");
            }
            catch (Exception) { MessageBox.Show("Everything gone wrong"); }
        }