Beispiel #1
0
        /// <summary>
        /// View Js
        /// </summary>
        private void ViewJavascript()
        {
            String[] DataList = SystemManager.SelectTagData.Split("/".ToCharArray());

            if (ViewTabList.ContainsKey(SystemManager.SelectTagData))
            {
                tabView.SelectTab(ViewTabList[SystemManager.SelectTagData]);
            }
            else
            {
                String JsName = DataList[(int)MongoDBHelper.PathLv.DocumentLV];
                ctlJsEditor JsEditor = new ctlJsEditor();
                JsEditor.strDBtag = SystemManager.SelectObjectTag;
                TabPage DataTab = new TabPage(JsName);
                DataTab.Tag = SystemManager.SelectObjectTag;
                DataTab.ImageIndex = 1;

                JsEditor.JsName = JsName;
                DataTab.Controls.Add(JsEditor);
                JsEditor.Dock = DockStyle.Fill;
                tabView.Controls.Add(DataTab);

                ToolStripMenuItem DataMenuItem = new ToolStripMenuItem(JsName);
                DataMenuItem.Tag = DataTab.Tag;
                DataMenuItem.Image = GetSystemIcon.TabViewImage.Images[1];
                JavaScriptStripMenuItem.DropDownItems.Add(DataMenuItem);
                DataMenuItem.Click += new EventHandler(
                     (x, y) => { tabView.SelectTab(DataTab); }
                );
                ViewTabList.Add(SystemManager.SelectTagData, DataTab);
                JsEditor.CloseTab += new System.EventHandler(
                    (x, y) =>
                    {
                        tabView.Controls.Remove(DataTab);
                        ViewTabList.Remove(SystemManager.SelectTagData);
                        JavaScriptStripMenuItem.DropDownItems.Remove(DataMenuItem);
                    }
                );
                tabView.SelectTab(DataTab);
            }
        }
Beispiel #2
0
        /// <summary>
        ///     View Js
        /// </summary>
        private void ViewJavascript()
        {
            String[] DataList = SystemManager.SelectTagData.Split("/".ToCharArray());

            if (_viewTabList.ContainsKey(SystemManager.SelectTagData))
            {
                tabView.SelectTab(_viewTabList[SystemManager.SelectTagData]);
            }
            else
            {
                String JsName = DataList[(int)MongoDbHelper.PathLv.DocumentLv];
                var JsEditor = new ctlJsEditor { strDBtag = SystemManager.SelectObjectTag };
                var DataTab = new TabPage(JsName) { Tag = SystemManager.SelectObjectTag, ImageIndex = 1 };

                JsEditor.JsName = JsName;
                DataTab.Controls.Add(JsEditor);
                JsEditor.Dock = DockStyle.Fill;
                tabView.Controls.Add(DataTab);

                var DataMenuItem = new ToolStripMenuItem(JsName)
                {
                    Tag = DataTab.Tag,
                    Image = GetSystemIcon.TabViewImage.Images[1]
                };
                JavaScriptStripMenuItem.DropDownItems.Add(DataMenuItem);
                DataMenuItem.Click += (x, y) => tabView.SelectTab(DataTab);
                _viewTabList.Add(SystemManager.SelectTagData, DataTab);
                JsEditor.CloseTab += (x, y) =>
                {
                    tabView.Controls.Remove(DataTab);
                    _viewTabList.Remove(SystemManager.SelectTagData);
                    JavaScriptStripMenuItem.DropDownItems.Remove(DataMenuItem);
                };
                tabView.SelectTab(DataTab);
            }
        }