private void DoEdit() { Debug.Assert(_clientLogic.CurrentScript != null); // used to rename if changed string originalName = _clientLogic.CurrentScript.Name; ScriptAddEdit scriptEdit = new ScriptAddEdit(_clientLogic, _clientLogic.CurrentScript, false); scriptEdit.Owner = this; if ((scriptEdit.ShowDialog() == true) && (!_clientLogic.CurrentScript.IsReadOnly)) { _clientLogic.AdminAddScript(_clientLogic.CurrentScript, originalName, true); } _actionOnScriptReady = ActionOnScriptReady.None; }
private void DoAdd() { StackHashScriptSettings scriptSettings = new StackHashScriptSettings(); scriptSettings.Script = new StackHashScript(); scriptSettings.IsReadOnly = false; scriptSettings.RunAutomatically = false; scriptSettings.Version = 1; scriptSettings.Owner = StackHashScriptOwner.User; ScriptAddEdit scriptAdd = new ScriptAddEdit(_clientLogic, scriptSettings, true); scriptAdd.Owner = this; if (scriptAdd.ShowDialog() == true) { _reselectScriptName = scriptSettings.Name; _clientLogic.AdminAddScript(scriptSettings, scriptSettings.Name, false); } }