Exemplo n.º 1
0
        /// <summary>
        /// Open file and show sorted data to user
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void OpenButton_OnClick(object sender, RoutedEventArgs e)
        {
            var sourceFilePath = GetFilePathOrDefault();

            if (sourceFilePath != null)
            {
                var table = await TableFileReader.ReadTable(sourceFilePath);

                table.Sort();

                SetTableToTableGrid(table);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Open file, sort data and write result data to result file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ProcessButton_OnClick(object sender, RoutedEventArgs e)
        {
            var sourceFilePath = GetFilePathOrDefault();

            if (sourceFilePath != null)
            {
                var table = await TableFileReader.ReadTable(sourceFilePath);

                table.Sort();

                var resultFilePath = Path.ChangeExtension(sourceFilePath, ".result");
                await TableFileSaver.SaveToFile(resultFilePath, table);

                MessageBox.Show("Data was sorted and saved", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }