Exemplo n.º 1
0
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Save changes to " + robotProgram.fileName + "?", "Save " + robotProgram.fileName + "?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                robotProgram.SaveProgram();
                robotProgram.changed = false;
            }
        }
Exemplo n.º 2
0
        private void newFileButton_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter           = "Robot ProGram|*.rpg";
            saveFileDialog.RestoreDirectory = true;
            saveFileDialog.InitialDirectory = System.IO.Path.GetFullPath(@"...\\Robot Programs");
            if (saveFileDialog.ShowDialog() == true)
            {
                robotProgram          = new RobotProgram();
                robotProgram.filePath = saveFileDialog.FileName;
                robotProgram.SaveProgram();
                InitialiseFileDisplay();
            }
        }