Пример #1
0
        private void OnGroupCheckChanged(object sender, EventArgs e)
        {
            var control = sender as MetroCheckBox;

            if (control.Tag.Equals("All"))
            {
                foreach (var it in group)
                {
                    it.CheckState = control.CheckState;
                }
            }
            if (OnGroupChanged != null)
            {
                OnGroupChanged.Invoke();
            }
        }
Пример #2
0
        void EditButtonClick(object sender, EventArgs e)
        {
            if (FEditing)
            {
                this.Height     = 32;
                EditButton.Text = "E";

                if (FGroupName != UNGROUPED)
                {
                    FIPControls.Clear();
                    List <string> ips = new List <string>();
                    foreach (string s in IPsEdit.Lines)
                    {
                        ips.Add(s);
                    }

                    string oldname = FGroupName;
                    GroupLabel.Text = GroupNameEdit.Text;
                    FGroupName      = GroupNameEdit.Text;

                    OnGroupChanged.Invoke(this, oldname, ips);
                }
            }
            else
            {
                this.Height = 52 + (FIPControls.Count + 1) * 20;
                string[] ips = new string[FIPControls.Count];
                for (int i = 0; i < ips.Length; i++)
                {
                    ips[i] = FIPControls[i].IP;
                }
                IPsEdit.Lines   = ips;
                EditButton.Text = "S";
            }

            FEditing = !FEditing;
        }