예제 #1
0
        public UserControl UcSetting = new UserControl(); // holds current settings user control

        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            var tmp = new UserControl();

            switch (e.Node.Name)
            {
            case "General":     // General
                tmp = new General();
                break;

            case "AutoPos":     // Auto postion
                tmp = new AutoPosition();
                break;

            case "PingCheck":
            case "ConnectionCheck":
                tmp = new SettingsTree.ConnectionCheck();
                break;

            case "IpHostCheck":
                tmp = new IpHostCheck();
                break;

            case "AntiIdle":
                tmp = new AntiIdle();
                break;

            case "ProfileKickstart":
                tmp = new ProfileKickstart();
                break;

            case "HotKeys":
                tmp = new HotKeys();
                break;

            case "Stats":
                tmp = new Stats();
                break;
            }

            // Check if new user control should be displayed
            if (!tmp.Name.Equals(UcSetting.Name))
            {
                //var c = tabControl1.TabPages[1].Controls;
                Control.ControlCollection c = SettingsPanel.Controls;
                if (c.Contains(UcSetting))
                {
                    c.Remove(UcSetting);
                }

                UcSetting = tmp;
                //_ucSetting.Left = 180;
                c.Add(UcSetting);
            }
        }
예제 #2
0
파일: Model.cs 프로젝트: KrolKamil/Clinic
 public void ShowDoctor(Control.ControlCollection FormControls)
 {
     if (!FormControls.Contains(Doctor.GetInstance))
     {
         FormControls.Add(Doctor.GetInstance);
         Doctor.GetInstance.Dock = DockStyle.Fill;
     }
     Doctor.GetInstance.BringToFront();
 }
예제 #3
0
파일: Model.cs 프로젝트: KrolKamil/Clinic
 public void ShowRegisteredUsers(Control.ControlCollection FormControls)
 {
     if (!FormControls.Contains(RegisteredUsers.GetInstance))
     {
         FormControls.Add(RegisteredUsers.GetInstance);
         RegisteredUsers.GetInstance.Dock = DockStyle.Fill;
     }
     RegisteredUsers.GetInstance.BringToFront();
 }
예제 #4
0
파일: Model.cs 프로젝트: KrolKamil/Clinic
 public void ShowDispayMenu(Control.ControlCollection FormControls)
 {
     if (!FormControls.Contains(DisplayMenu.GetInstance))
     {
         FormControls.Add(DisplayMenu.GetInstance);
         DisplayMenu.GetInstance.Dock = DockStyle.Fill;
     }
     DisplayMenu.GetInstance.BringToFront();
 }
예제 #5
0
        private void loadSample(SampleInfo sample)
        {
            if (sample != null)
            {
                if (sample.FormName.StartsWith(@"ComponentOne\Demos\"))
                {
                    // run standalone demo or demo installer
                    RunDemo(sample.FormName);
                    return;
                }
                try
                {
                    this.Cursor = Cursors.AppStarting;
                    LockWindowUpdate(Handle);
                    if (breadCrumb.Items.Count == 2)
                    {
                        BreadCrumbItem item = breadCrumb.AddItem(sample.Name);
                        item.Tag = ExplorerMode.Samples;
                    }
                    else
                    {
                        breadCrumb.RemoveTop();
                        BreadCrumbItem item = breadCrumb.AddItem(sample.Name);
                        item.Tag = ExplorerMode.Samples;
                    }
                    string description = sample.LongDescription;
                    if (description == null || description == "")
                    {
                        description = sample.ShortDescription;
                    }
                    lblLeftDescriptionSamples.Text = description;

                    // load sample form
                    _activeForm = _viewer.Run(sample.FormName, sample.Name, sample.LongDescription);
                    // attach viewer if it is not attached yet
                    Control.ControlCollection collection = pnlMainSamples.Controls;
                    if (!collection.Contains(_viewer))
                    {
                        collection.Clear();
                        collection.Add(_viewer);
                        _viewer.Visible = true;
                    }
                    TheExplorer.CurrentExplorerMode = ExplorerMode.Samples;
                }
                finally
                {
                    LockWindowUpdate(IntPtr.Zero);
                    this.Cursor = Cursors.Default;
                }
            }
        }
        public static void displayFormOnPanel(Control.ControlCollection control, Form newForm)
        {
            bool isExist = control.Contains(newForm);

            if (isExist == false)
            {
                newForm.TopLevel        = false;                               //设置为非顶级窗体
                newForm.FormBorderStyle = FormBorderStyle.None;                //设置窗体为非边框样式
                newForm.Dock            = System.Windows.Forms.DockStyle.Fill; //设置样式是否填充整个PANEL
                control.Add(newForm);                                          //添加窗体
                newForm.Show();
            }
            newForm.BringToFront();
        }
예제 #7
0
 // Token: 0x0600019D RID: 413 RVA: 0x00002B70 File Offset: 0x00000D70
 static bool smethod_26(Control.ControlCollection controlCollection_0, Control control_0)
 {
     return(controlCollection_0.Contains(control_0));
 }
 /// <summary>
 /// Indicates whether the collection contains the specified control
 /// </summary>
 /// <param name="value">The control to search for</param>
 /// <returns>Returns a boolean indicating whether that control is
 /// found in the collection</returns>
 public bool Contains(IControlHabanero value)
 {
     return(_col.Contains((Control)value));
 }
예제 #9
0
 /// <summary>
 /// Determines whether the XPanderPanelCollection contains a specific XPanderPanel
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to locate in the XPanderPanelCollection</param>
 /// <returns>true if the XPanderPanelCollection contains the specified value; otherwise, false.</returns>
 public bool Contains(XPanderPanel xpanderPanel)
 {
     return(m_controlCollection.Contains(xpanderPanel));
 }
예제 #10
0
        public static void Validate(this Control.ControlCollection controls, Control.ControlCollection controlsToIgnore)
        {
            if (controls == null || controls.Count == 0)
            {
                return;
            }

            var controlsConverted = controls.Cast <Control>().Where(a => controlsToIgnore != null ? !controlsToIgnore.Contains(a) : true).OrderBy(a => a.TabIndex).ToList <Control>();

            foreach (var control in controlsConverted)
            {
                if (control.Controls.Count > 0)
                {
                    control.Controls.Validate();
                }

                if (control is CButtonEdit)
                {
                    (control as CButtonEdit).Validate();
                }
                else if (control is CComboBoxEdit)
                {
                    (control as CComboBoxEdit).Validate();
                }
                else if (control is CTextEdit)
                {
                    (control as CTextEdit).Validate();
                }
                else if (control is CMemoEdit)
                {
                    (control as CMemoEdit).Validate();
                }
                else if (control is CSpinEdit)
                {
                    (control as CSpinEdit).Validate();
                }
            }
        }