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(); }
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(); }
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); }
private void SetCheckState(int visgroupId, ICollection <MapObject> visItems) { var numHidden = visItems.Count(x => x.IsVisgroupHidden); CheckState state; if (numHidden == visItems.Count) { state = CheckState.Unchecked; // All hidden } else if (numHidden > 0) { state = CheckState.Indeterminate; // Some hidden } else { state = CheckState.Checked; // None hidden } VisgroupPanel.SetCheckState(visgroupId, state); }
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); } } }
private void VisgroupsChanged() { VisgroupPanel.Update(DocumentManager.CurrentDocument); }
private void DocumentActivated() { VisgroupPanel.Update(DocumentManager.CurrentDocument); }
public void Clear() { VisgroupPanel.Clear(); }
private void UpdateVisgroups() { VisgroupPanel.Update(_visgroups); }