Class CheckedLayerList
- Namespace
- CADability.Attribute
- Assembly
- CADability.dll
A collapsable treeview entry for the ControlCenter that presents to the user all layers of the provided list with a checkbox next to each layer. The titel of the entry is specified by the provided resourceId.
public class CheckedLayerList : IShowPropertyImpl, IShowProperty, IPropertyEntry, ICommandHandler, ISerializable, IDeserializationCallback
- Inheritance
-
CheckedLayerList
- Implements
- Inherited Members
Constructors
CheckedLayerList(LayerList, Layer[], string)
Creates a new CheckedLayerList with the provided layer list and a set of initially checked layers
public CheckedLayerList(LayerList layerList, Layer[] checkedLayers, string resourceId)
Parameters
layerListLayerListList of all layers to display
checkedLayersLayer[]Subset of the layerlist that is to be checked initially
resourceIdstringResource id for the title of the Controlcenter entry
CheckedLayerList(SerializationInfo, StreamingContext)
Constructor required by deserialization
protected CheckedLayerList(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoSerializationInfo
contextStreamingContextStreamingContext
Properties
Checked
Returns all checked Layers
public Layer[] Checked { get; }
Property Value
- Layer[]
ContextMenu
Implementation of ContextMenu: the default returns null. An entry whose LabelType contains ContextMenu must override it.
public override MenuWithHandler[] ContextMenu { get; }
Property Value
EntryType
Overrides EntryType, returns GroupTitle.
public override ShowPropertyEntryType EntryType { get; }
Property Value
LabelType
How the label of this entry behaves (see ShowPropertyLabelFlags): whether it can be selected or edited, is bold or has a context menu. The default implementation returns Selectable.
public override ShowPropertyLabelFlags LabelType { get; }
Property Value
SubEntries
The sub entries shown below this entry when it is opened in the property page. The default implementation has none and returns an empty array.
public override IShowProperty[] SubEntries { get; }
Property Value
SubEntriesCount
The number of SubEntries, 0 for an entry that cannot be opened. The default implementation returns 0.
public override int SubEntriesCount { get; }
Property Value
Methods
IsLayerChecked(Layer)
Tests whether the given layer is checked, e.g. whether it is visible in the view this list belongs to.
public bool IsLayerChecked(Layer l)
Parameters
lLayerthe layer (compared by reference)
Returns
- bool
true if the layer is checked
OnCommand(string)
Process the command with the given MenuId. Return true if handled, false otherwise.
public virtual bool OnCommand(string MenuId)
Parameters
MenuIdstring
Returns
- bool
true, if handled, false otherwise
OnUpdateCommand(string, CommandState)
Update the command user interface of the given command. Return true if handled, false otherwise.
public virtual bool OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
MenuIdstringCommandStateCommandState
Returns
- bool
true, if handled, false otherwise
Refresh()
Forces the entry to refresh its contents
public override void Refresh()
Set(Layer, bool)
Checks or unchecks the given layer programmatically. When the state actually changes, the CheckStateChangedEvent is raised just as if the user had clicked the checkbox, and the entry is refreshed in the control center.
public void Set(Layer l, bool check)
Parameters
Events
CheckStateChangedEvent
Event that gets called when the user changes the checbox next to a layer.
public event CheckedLayerList.CheckStateChangedDelegate CheckStateChangedEvent