Ejemplo n.º 1
0
        private void convertToPN(string kwsnName)
        {
            string kwsnPath = CURRENT_PATH + BEFORE_FOLDER + "\\" + kwsnName + ".kwsn";
            WSNTabItem wsnTabItem = new WSNTabItem("KWSN Model", "KWSN", null);
            wsnTabItem.Open(kwsnPath);

            string pnName = CURRENT_PATH + PN_FOLDER + "\\" + kwsnName + ".pn"; // 13486468456456.pn
            PNGenerationHelper helper = new PNGenerationHelper(pnName, wsnTabItem);
            XmlDocument pnFile = helper.GenerateXML(false, false);
            pnFile.Save(helper.GetGeneratedFileName());
        }
Ejemplo n.º 2
0
        private void convertToPN(string kwsnFileName)
        {
            do
            {
                WSNTabItem wsnTabItem = new WSNTabItem("KWSN Model", "KWSN", null);
                wsnTabItem.Open(kwsnFileName);

                string pnName = DateTime.Now.Millisecond.ToString() + ".pn"; // 13486468456456.pn
                PNGenerationHelper helper = new PNGenerationHelper(pnName, wsnTabItem);
                helper.GenerateXML(false, false);

                bool cne = createModule();
                if (cne == false)
                    break;

            } while (false);
        }
Ejemplo n.º 3
0
        public EditorTabItem AddDocument(string moduleName)
        {
            bool registerMouseEvent = DockContainer.Panes.Count == 0;
            EditorTabItem tabItem;

            do
            {
                if (moduleName == "PN Model")
                {
                    tabItem = new PNTabItem(moduleName);
                    break;
                }

                if (moduleName == "KWSN Model")
                {
                    tabItem = new WSNTabItem(moduleName, "KWSN", this);
                    break;
                }

                tabItem = new EditorTabItem(moduleName);
            } while (false);

            tabItem.Tag = "";
            tabItem.Show(DockContainer, DockState.Document);
            tabItem.CodeEditor.LineViewerStyle = (MenuButton_HignlightCurrentLine.Checked) ? LineViewerStyle.FullRow : LineViewerStyle.None;
            tabItem.FormClosing += new FormClosingEventHandler(tabItem_FormClosing);
            if (NewCodeEditor != null)
                NewCodeEditor(this, new NewCodeEditorEventArgs(ref tabItem));

            tabItem.CodeEditor.TextChanged += new EventHandler(editorControl_TextChanged);
            tabItem.CodeEditor.KeyUp += new KeyEventHandler(editorControl_KeyUp);
            tabItem.CodeEditor.ActiveTextAreaControl.TextArea.DragDrop += new DragEventHandler(CodeEditor_DragDrop);
            tabItem.TabActivited += new EditorTabItem.TabActivitedHandler(tabItem_Activated);

            tabItem.CodeEditor.ActiveTextAreaControl.Caret.CaretModeChanged += new EventHandler(CaretModeChanged);
            tabItem.CodeEditor.ActiveTextAreaControl.Enter += new EventHandler(Caret_Change);
            tabItem.CodeEditor.ActiveTextAreaControl.Caret.PositionChanged += Caret_Change;
            tabItem.IsDirtyChanged += new EventHandler(editorControl_TextChanged);
            tabItem.FindUsages += new EditorTabItem.FindUsagesHandler(tabItem_FindUsages);
            tabItem.GoToDeclarition += new EditorTabItem.GoToDeclaritionHandler(OpenException);

            MenuButton_Window.DropDownItems.Add(tabItem.WindowMenuItem);
            tabItem.WindowMenuItem.Click += new EventHandler(WindowMenuItem_Click);
            tabItem.Activate();

            CurrentActiveTab = tabItem;
            if (registerMouseEvent)
                DockContainer.Panes[0].TabStripControl.MouseDown += new MouseEventHandler(FormMain_MouseDown);

            return tabItem;
        }