示例#1
0
 private bool CanExecuteRemoveScript(Script script)
 {
     return script != null && script.IsRemovable;
 }
示例#2
0
 private void ExecuteRemoveScript(Script script)
 {
     Scripts.Remove(script);
 }
示例#3
0
 private bool CanExecuteEditScript(Script script)
 {
     return script != null;
 }
示例#4
0
        private void ExecuteEditScript(Script script)
        {
            if (script is ScriptExpression)
            {
                ScriptExpression expression = (ScriptExpression)script;
                ScriptEditorWindow editor = new ScriptEditorWindow();
                editor.Owner = App.Current.MainWindow;
                editor.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                editor.Expression = expression.Expression;

                if (editor.ShowDialog() == true)
                {
                    expression.Expression = editor.Expression;
                }
            }
            else if (script is ScriptFile)
            {
                ScriptFile scriptFile = (ScriptFile)script;
                Process.Start("notepad.exe", scriptFile.Path);
            }
        }