예제 #1
0
        public void AddLinkViewAtCurrentScript(LinkView newLinkView)
        {
            ScriptTabPage tabPage      = (ScriptTabPage)scriptsTabControl.SelectedTab;
            ScriptCanvas  scriptCanvas = tabPage.TheScriptCanvas;

            scriptCanvas.AddLinkView(newLinkView);
        }
예제 #2
0
        public void adjustLinkViewAtCurrentScript(LinkModel linkModel, bool isOutgoingLink)
        {
            ScriptTabPage tabPage      = (ScriptTabPage)scriptsTabControl.SelectedTab;
            ScriptCanvas  scriptCanvas = tabPage.TheScriptCanvas;

            scriptCanvas.setDataByLinkModel(linkModel, isOutgoingLink);
        }
예제 #3
0
        // 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;
        }
예제 #4
0
        public bool deleteLinkView(LinkModel linkModel)
        {
            if (SimulationManager.checkSimulating())
            {
                return(false);
            }

            ScriptTabPage tabPage      = (ScriptTabPage)scriptsTabControl.SelectedTab;
            ScriptCanvas  scriptCanvas = tabPage.TheScriptCanvas;

            scriptCanvas.deleteLinkView(linkModel);
            return(true);
        }