Table of Contents

Class CheckedAttributes

Namespace
CADability.Attribute
Assembly
CADability.dll

Shows a list of Attributes as checkboxes.

public class CheckedAttributes : IShowPropertyImpl, IShowProperty, IPropertyEntry, ICommandHandler
Inheritance
CheckedAttributes
Implements
Inherited Members

Constructors

CheckedAttributes(string, IAttributeList, Filter)

Creates the group of check boxes for the entries of an attribute list.

public CheckedAttributes(string resourceId, IAttributeList attributeList, Filter filter)

Parameters

resourceId string

resource id of the label and the tooltip of the group, e.g. "Filter.LayerList"

attributeList IAttributeList

the list whose entries are shown, one check box per entry

filter Filter

the filter whose set of accepted attributes is displayed and modified

Properties

ContextMenu

Implementation of ContextMenu: the default returns null. An entry whose LabelType contains ContextMenu must override it.

public override MenuWithHandler[] ContextMenu { get; }

Property Value

MenuWithHandler[]

EntryType

Overrides EntryType, returns GroupTitle.

public override ShowPropertyEntryType EntryType { get; }

Property Value

ShowPropertyEntryType

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

ShowPropertyLabelFlags

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

IShowProperty[]

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

int

Methods

Added(IPropertyPage)

Implementation of Added(IPropertyPage): memorizes the property page in propertyPage. Unlike Added(IPropertyTreeView) it does not raise the state changed event. Override it to subscribe to events while the entry is displayed, and call the base implementation.

public override void Added(IPropertyPage pp)

Parameters

pp IPropertyPage

the property page the entry was added to

GetChecked(string)

Tells whether the attribute with the given name is accepted by the filter. The check boxes call it by reflection to determine their state.

public bool GetChecked(string name)

Parameters

name string

the name of an attribute of the list

Returns

bool

true when the filter accepts the attribute, false when it does not or no attribute with that name exists

OnCommand(string)

Handles the commands of the context menu of the group: "MenuId.AttributeFilter.SelectAll" accepts all attributes of the list and "MenuId.AttributeFilter.SelectNone" accepts none; the check boxes are refreshed. Override it to handle additional menu items.

public virtual bool OnCommand(string MenuId)

Parameters

MenuId string

the id of the menu item

Returns

bool

true when the command was handled

OnUpdateCommand(string, CommandState)

Updates the state of a menu item before the context menu is shown. The menu items of this group have no state, so it returns false; override it to set the state of additional menu items.

public virtual bool OnUpdateCommand(string MenuId, CommandState CommandState)

Parameters

MenuId string

the id of the menu item

CommandState CommandState

receives the enabled and checked state

Returns

bool

true when the state was set

Removed(IPropertyPage)

Implementation of Removed(IPropertyPage): forgets the property page. Override it to unsubscribe from events, and call the base implementation.

public override void Removed(IPropertyPage pp)

Parameters

pp IPropertyPage

the property page the entry was removed from

SetChecked(string, bool)

Adds the attribute with the given name to or removes it from the attributes accepted by the filter. The check boxes call it by reflection when the user toggles them. Does nothing when no attribute with that name exists.

public void SetChecked(string name, bool check)

Parameters

name string

the name of an attribute of the list

check bool

true: accept the attribute, false: do not accept it