コード例 #1
0
        /// <summary> Helper method for checking a selection checkbox of one of the layers. Updates the selection checkboxes. </summary>
        /// <param name="sender"> Sender of the Checked event. </param>
        /// <param name="selectable"> Shows if the layer is marked to be selectable or not. </param>
        private void selection_Common(object sender, bool selectable)
        {
            if (updateByExclusiveSelection)
            {
                return; // Nothing to do because the setting is applied indirectly und would cause errors.
            }
            if (layers.ExclusiveSelectableLayer == null)
            {
                // No exclusive layer: Toggle the selectable flag according the CheckBox
                layers.SetSelectable(layers[(sender as CheckBox)?.Tag as string], selectable);
            }
            else
            {
                // If an exclusive layer is activated and the LMB is clicked,
                // the exclusive mode is reset. All standard selection settings
                // are restored.
                layers.ExclusiveSelectableLayer = null;
            }

            UpdateSelection();
        }