Beispiel #1
0
        private void initParseSpecifinication(string fName)
        {
            if (mTabItem == null)
                mTabItem = new PNTabItem(MODULE_NAME);

            mTabItem.Open(fName);
        }
Beispiel #2
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;
        }