Example #1
0
        private void CmdTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            switch (e.Node.Name)
            {
            case "Login":
            {
                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_LoginForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Add(m_LoginForm);
                    m_LoginForm.Dock = DockStyle.Fill;
                    m_LoginForm.Show();
                }
            }
            break;

            case "Run":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_RunForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Add(m_RunForm);
                    m_RunForm.Dock = DockStyle.Fill;
                    m_RunForm.Show();
                }
            }
            break;

            case "Manual":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Add(m_ManualDebugForm);
                    m_ManualDebugForm.Dock = DockStyle.Fill;
                    m_ManualDebugForm.Show();
                    m_ManualDebugForm.InitUIControlEnableState();
                }
            }
            break;

            case "SystemSeting":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_SystemSetingForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Add(m_SystemSetingForm);
                    m_SystemSetingForm.Dock = DockStyle.Fill;
                    m_SystemSetingForm.Show();
                }
            }
            break;

            case "UserLimits":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Add(m_UserLimitsForm);
                    m_UserLimitsForm.Dock = DockStyle.Fill;
                    m_UserLimitsForm.Show();
                }
            }
            break;

            case "Exit":
            {
                VisualSortingStation.ShouldExit = true;
                if (m_MyTcpServer != null)
                {
                    m_MyTcpServer.CloseServer();
                }

                CloseForm();
            }
            break;

            default:
                break;
            }
        }
Example #2
0
        private void CmdTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            switch (e.Node.Name)
            {
            case "Login":
            {
                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_LoginForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Clear();
                    SplitContainerFromMain.Panel1.Controls.Add(m_LoginForm);
                    m_LoginForm.Dock = DockStyle.Fill;
                    m_LoginForm.Show();
                }
            }
            break;

            case "Run":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_RunForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Clear();
                    SplitContainerFromMain.Panel1.Controls.Add(m_RunForm);
                    m_RunForm.Dock = DockStyle.Fill;
                    m_RunForm.Show();
                }
            }
            break;

            case "Manual":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Clear();
                    SplitContainerFromMain.Panel1.Controls.Add(m_ManualDebugForm);
                    m_ManualDebugForm.Dock = DockStyle.Fill;
                    m_ManualDebugForm.Show();
                }
            }
            break;

            case "SystemSeting":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    m_UserLimitsForm.Hide();
                }

                if (m_SystemSetingForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Clear();
                    SplitContainerFromMain.Panel1.Controls.Add(m_SystemSetingForm);
                    m_SystemSetingForm.Dock = DockStyle.Fill;
                    m_SystemSetingForm.Show();
                }
            }
            break;

            case "UserLimits":
            {
                if (m_LoginForm != null)
                {
                    m_LoginForm.Hide();
                }

                if (m_RunForm != null)
                {
                    m_RunForm.Hide();
                }

                if (m_ManualDebugForm != null)
                {
                    m_ManualDebugForm.HideFormAndSaveConfigFile();
                }

                if (m_SystemSetingForm != null)
                {
                    m_SystemSetingForm.HideFormAndSaveConfigFile();
                }

                if (m_UserLimitsForm != null)
                {
                    SplitContainerFromMain.Panel1.Controls.Clear();
                    SplitContainerFromMain.Panel1.Controls.Add(m_UserLimitsForm);
                    m_UserLimitsForm.Dock = DockStyle.Fill;
                    m_UserLimitsForm.Show();
                }
            }
            break;

            case "Exit":
            {
                CloseForm();
            }
            break;

            default:
                break;
            }
        }