コード例 #1
0
        private void UpdateVisgroups(bool retainCheckStates)
        {
            _populating = true;

            var visgroups = Document.Map.Visgroups.Select(x => x.Clone()).ToList();

            Action <Visgroup> setVisible = null;

            setVisible = x =>
            {
                x.Visible = false;
                x.Children.ForEach(y => setVisible(y));
            };
            visgroups.ForEach(x => setVisible(x));

            Dictionary <int, CheckState> states;

            if (retainCheckStates)
            {
                states = VisgroupPanel.GetAllCheckStates();
            }
            else
            {
                states = Objects.SelectMany(x => x.Visgroups)
                         .GroupBy(x => x)
                         .Select(x => new { ID = x.Key, Count = x.Count() })
                         .Where(g => g.Count > 0)
                         .ToDictionary(g => g.ID, g => g.Count == Objects.Count
                                                      ? CheckState.Checked
                                                      : CheckState.Indeterminate);
            }

            VisgroupPanel.Update(visgroups);

            foreach (var kv in states)
            {
                VisgroupPanel.SetCheckState(kv.Key, kv.Value);
            }

            VisgroupPanel.ExpandAllNodes();

            _populating = false;
        }
コード例 #2
0
 private void VisgroupsChanged()
 {
     VisgroupPanel.Update(DocumentManager.CurrentDocument);
 }
コード例 #3
0
 private void DocumentAllClosed()
 {
     VisgroupPanel.Update(DocumentManager.CurrentDocument);
 }