Пример #1
0
        private void RemoveGroup(object sender, EventArgs e)
        {
            var id = VisgroupPanel.GetSelectedVisgroup();

            if (!id.HasValue)
            {
                return;
            }
            var vg = _visgroups.First(x => x.ID == id.Value);

            _visgroups.Remove(vg);
            _deleted.Add(vg);
            UpdateVisgroups();
        }
Пример #2
0
        private void AddGroup(object sender, EventArgs e)
        {
            var newGroup = new Visgroup
            {
                ID      = GetNewID(),
                Colour  = Colour.GetRandomLightColour(),
                Name    = "New Group",
                Visible = true
            };

            _visgroups.Add(newGroup);
            UpdateVisgroups();
            VisgroupPanel.SetSelectedVisgroup(newGroup.ID);
            GroupName.SelectAll();
            GroupName.Focus();
        }
Пример #3
0
        private void GroupNameChanged(object sender, EventArgs e)
        {
            var id = VisgroupPanel.GetSelectedVisgroup();

            if (!id.HasValue)
            {
                return;
            }
            var vg = _visgroups.First(x => x.ID == id.Value);

            if (vg.Name == GroupName.Text)
            {
                return;
            }
            vg.Name = GroupName.Text;
            VisgroupPanel.UpdateVisgroupName(id.Value, GroupName.Text);
        }
Пример #4
0
 public void InitVisgroupPanel()
 {
     VisgroupPanel        = new VisgroupPanel();
     VisgroupPanel.Anchor = ((AnchorStyles.Top | AnchorStyles.Bottom)
                             | AnchorStyles.Left)
                            | AnchorStyles.Right;
     VisgroupPanel.DisableAutomatic   = false;
     VisgroupPanel.HideAutomatic      = true;
     VisgroupPanel.Location           = new Point(12, 12);
     VisgroupPanel.Name               = "VisgroupPanel";
     VisgroupPanel.ShowCheckboxes     = false;
     VisgroupPanel.ShowHidden         = false;
     VisgroupPanel.Size               = new Size(233, 323);
     VisgroupPanel.SortAutomaticFirst = false;
     VisgroupPanel.TabIndex           = 0;
     VisgroupPanel.VisgroupSelected  += new VisgroupPanel.VisgroupSelectedEventHandler(SelectionChanged);
     Controls.Add(VisgroupPanel);
 }
Пример #5
0
        private void ColourClicked(object sender, EventArgs e)
        {
            var id = VisgroupPanel.GetSelectedVisgroup();

            if (!id.HasValue)
            {
                return;
            }
            var vg = _visgroups.First(x => x.ID == id.Value);

            using (var cp = new ColorDialog {
                Color = vg.Colour
            })
            {
                if (cp.ShowDialog() == DialogResult.OK)
                {
                    vg.Colour = cp.Color;
                    VisgroupPanel.UpdateVisgroupColour(id.Value, cp.Color);
                }
            }
        }
Пример #6
0
 private void UpdateVisgroups()
 {
     VisgroupPanel.Update(_visgroups);
 }