public void AddLinkViewAtCurrentScript(LinkView newLinkView) { ScriptTabPage tabPage = (ScriptTabPage)scriptsTabControl.SelectedTab; ScriptCanvas scriptCanvas = tabPage.TheScriptCanvas; scriptCanvas.AddLinkView(newLinkView); }
public void adjustLinkViewAtCurrentScript(LinkModel linkModel, bool isOutgoingLink) { ScriptTabPage tabPage = (ScriptTabPage)scriptsTabControl.SelectedTab; ScriptCanvas scriptCanvas = tabPage.TheScriptCanvas; scriptCanvas.setDataByLinkModel(linkModel, isOutgoingLink); }
// add new tab-page of a script private void addNewTabPage(ScriptModel scriptModel, bool shouldMarkAsUnsaved) { if (scriptModel == null) { return; } // get state-model list List <StateModel> stateModels = scriptModel.getCopiedStateList(); if (stateModels == null) { new AlertForm("Alert", "Something is wrong, I can feel it.").ShowDialog(); return; } // create a new tab-page ScriptTabPage tabPage = new ScriptTabPage(scriptModel.Name, stateModels); scriptsTabControl.TabPages.Add(tabPage); // select the new script scriptsTabControl.SelectedIndex = scriptsTabControl.TabPages.Count - 1; // mark as unsaved if needs if (shouldMarkAsUnsaved) { MarkUnsavedScript(); } // set the selected script index ModelManager.CurrentSelectedScriptIndex = scriptsTabControl.SelectedIndex; }
public bool deleteLinkView(LinkModel linkModel) { if (SimulationManager.checkSimulating()) { return(false); } ScriptTabPage tabPage = (ScriptTabPage)scriptsTabControl.SelectedTab; ScriptCanvas scriptCanvas = tabPage.TheScriptCanvas; scriptCanvas.deleteLinkView(linkModel); return(true); }