Ejemplo n.º 1
0
        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string way = openFileDialog.FileName;

            flatness.ReadToFile(way);
            RefreshData();
        }
Ejemplo n.º 2
0
        private void OpenFileButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.ShowDialog();
            if (openFileDialog.FileName.Length == 0)
            {
                return;
            }
            try
            {
                string way = openFileDialog.FileName;
                flatness.ReadToFile(way);
                RefreshData();
            }
            catch
            {
                msgTextBlock.Text = "Не удалось прочитать файл";
            }
        }