private bool CanExecuteRemoveScript(Script script) { return script != null && script.IsRemovable; }
private void ExecuteRemoveScript(Script script) { Scripts.Remove(script); }
private bool CanExecuteEditScript(Script script) { return script != null; }
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); } }