Exemple #1
0
        /// <summary>
        ///     Load Form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMain_Load(object sender, EventArgs e)
        {
            //加载到菜单
            PlugIn.LoadPlugInMenuItem(plugInToolStripMenuItem);
            //禁用操作
            DisableAllOpr();
            //Set Tool bar button enable
            SetToolBarEnabled();
            //Open ConnectionManagement Form
            UIAssistant.OpenModalForm(new frmConnect(), true, true);

            //多文档管理器的设定
            var parentMenuItems = new List <ToolStripMenuItem>
            {
                CollectionToolStripMenuItem,
                JavaScriptStripMenuItem
            };

            MultiTabManger.Init(tabView, parentMenuItems);
            //MultiTab固定项目的初始化
            var serverStatusCtl = new CtlServerStatus()
            {
                IsFixedItem     = true,
                SelectObjectTag = "[ServerStatus]",
                BindingMenu     = StatusToolStripMenuItem
            };

            MultiTabManger.AddView(serverStatusCtl, GuiConfig.IsUseDefaultLanguage ? "Status" : GuiConfig.GetText("MainMenu.MangtStatus"), string.Empty);

            //刷新
            RefreshToolStripMenuItem_Click(sender, e);
            serverStatusCtl.RefreshGui();
            MultiTabManger.SelectTab("[ServerStatus]");

            //委托设置
            trvsrvlst.NodeMouseClick        += trvsrvlst_NodeMouseClick;
            trvsrvlst.NodeMouseDoubleClick  += (x, y) => ViewDataObj();
            ViewDataToolStripMenuItem.Click += (x, y) => ViewDataObj();
            trvsrvlst.KeyDown            += trvsrvlst_KeyDown;
            tabView.SelectedIndexChanged += tabView_SelectedIndexChanged;
            //CommandHelper.RunCommandComplete += CommandLog;
            //长时间操作时候,实时提示进度在状态栏中
            lblAction.Text          = string.Empty;
            MongoHelper.ActionDone += (x, y) =>
            {
                //1.lblAction 没有InvokeRequired
                //2.DoEvents必须
                lblAction.Text = y.Message;
                Application.DoEvents();
            };
            if (trvsrvlst.Nodes.Count > 0)
            {
                trvsrvlst.SelectedNode = trvsrvlst.Nodes[0];
            }
        }
Exemple #2
0
        /// <summary>
        ///     Load Form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMain_Load(object sender, EventArgs e)
        {
            //加载到菜单
            PlugIn.LoadPlugInMenuItem(plugInToolStripMenuItem);
            //禁用操作
            DisableAllOpr();
            //Set Tool bar button enable
            SetToolBarEnabled();
            //Open ConnectionManagement Form
            Utility.OpenForm(new FrmConnect(), true, true);

            //多文档管理器的设定
            var parentMenuItems = new List <ToolStripMenuItem>();

            parentMenuItems.Add(CollectionToolStripMenuItem);
            parentMenuItems.Add(JavaScriptStripMenuItem);
            MultiTabManger.Init(tabView, parentMenuItems);
            //MultiTab固定项目的初始化
            var serverStatusCtl = new CtlServerStatus();

            serverStatusCtl.IsFixedItem     = true;
            serverStatusCtl.SelectObjectTag = "[ServerStatus]";
            serverStatusCtl.BindingMenu     = StatusToolStripMenuItem;
            MultiTabManger.AddView(serverStatusCtl, "Status");

            var ctlShellCommandEditor = new CtlJsEditor();

            ctlShellCommandEditor.IsFixedItem     = true;
            ctlShellCommandEditor.SelectObjectTag = "[ShellCommand]";
            ctlShellCommandEditor.BindingMenu     = commandShellToolStripMenuItem;
            MultiTabManger.AddView(ctlShellCommandEditor, "ShellCommand");


            //刷新
            RefreshToolStripMenuItem_Click(sender, e);
            serverStatusCtl.RefreshGui();
            MultiTabManger.SelectTab("[ServerStatus]");

            //委托设置
            trvsrvlst.NodeMouseClick        += trvsrvlst_NodeMouseClick;
            trvsrvlst.NodeMouseDoubleClick  += (x, y) => ViewDataObj();
            ViewDataToolStripMenuItem.Click += (x, y) => ViewDataObj();
            trvsrvlst.KeyDown            += trvsrvlst_KeyDown;
            tabView.SelectedIndexChanged += tabView_SelectedIndexChanged;
            //CommandHelper.RunCommandComplete += CommandLog;
            //长时间操作时候,实时提示进度在状态栏中
            lblAction.Text          = string.Empty;
            MongoHelper.ActionDone += (x, y) =>
            {
                //1.lblAction 没有InvokeRequired
                //2.DoEvents必须
                lblAction.Text = y.Message;
                Application.DoEvents();
            };
        }