private void OnLoadScriptCommand()
        {
            if (Commands.Count > 0)
            {
                MessageBoxResult messageBoxResult = MessageBox.Show(
                    "You will lose current script.\nAre you sure you want to continue?",
                    "Arm controller",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Warning);
                if (messageBoxResult != MessageBoxResult.Yes)
                {
                    return;
                }
            }
            OpenFileDialog dialogue = new OpenFileDialog();

            dialogue.DefaultExt = ".xml";
            dialogue.Filter     = "XML Files (*.xml)|*.xml";
            bool?result = dialogue.ShowDialog();

            if (result == true)
            {
                ArmScript script = ArmScript.ReadArmScript(dialogue.FileName);
                Commands.Clear();
                script.Movements.ForEach((command) => Commands.Add(command));
            }
        }
Beispiel #2
0
 private void LoadScriptFromFile(string path)
 {
     Script = ArmScript.ReadArmScript(path);
 }