Class Filter
This class filters IGeoObjects according to their attributes or other properties.
A Project contains a FilterList which contains Filters. The task of a filter
is to decide, whether a IGeoObject is accepted by this filter or not. The FilterList is
used by the
Inherited Members
Namespace: CADability.Attribute
Assembly: CADability.dll
Syntax
[Serializable]
public class Filter : IShowPropertyImpl, IShowProperty, IPropertyEntry, ISerializable, ICommandHandler
Constructors
| Improve this Doc View SourceFilter()
Constructs an empty filter which accepts everything
Declaration
protected Filter()
Filter(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Filter(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | SerializationInfo |
| System.Runtime.Serialization.StreamingContext | context | StreamingContext |
Fields
| Improve this Doc View SourceConstructor
Set this static delegate to your own method which creates your Filter-derived class.
Declaration
public static Filter.ConstructionDelegate Constructor
Field Value
| Type | Description |
|---|---|
| Filter.ConstructionDelegate |
Properties
| Improve this Doc View SourceContextMenu
Declaration
public override MenuWithHandler[] ContextMenu { get; }
Property Value
| Type | Description |
|---|---|
| MenuWithHandler[] |
Overrides
| Improve this Doc View SourceEntryType
Overrides EntryType, returns GroupTitle.
Declaration
public override ShowPropertyEntryType EntryType { get; }
Property Value
| Type | Description |
|---|---|
| ShowPropertyEntryType |
Overrides
| Improve this Doc View SourceIsActive
Gets or sets the active flag. Only active filters in a FilterList are used for filtering.
Declaration
public bool IsActive { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LabelText
Declaration
public override string LabelText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
| Improve this Doc View SourceLabelType
Overrides LabelType
Declaration
public override ShowPropertyLabelFlags LabelType { get; }
Property Value
| Type | Description |
|---|---|
| ShowPropertyLabelFlags |
Overrides
| Improve this Doc View SourceName
Name of the Filter
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
SubEntries
Overrides SubEntries, returns the subentries in this property view.
Declaration
public override IShowProperty[] SubEntries { get; }
Property Value
| Type | Description |
|---|---|
| IShowProperty[] |
Overrides
| Improve this Doc View SourceSubEntriesCount
Overrides SubEntriesCount, returns the number of subentries in this property view.
Declaration
public override int SubEntriesCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Methods
| Improve this Doc View SourceAccept(IGeoObject)
Checks whether an IGeoObject is accepted by this filter. To realize custom filters, override this method.
Declaration
public virtual bool Accept(IGeoObject go)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | go | The object beeing tested |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if accepted, fale otherwise |
AcceptType(Type, Boolean)
Adds or removes the provided type to or from the list of accepted types. The type must be derived from IGeoObject.
Declaration
public virtual void AcceptType(Type type, bool doAccept)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | the type to add or remove |
| System.Boolean | doAccept | true: accept this type, false: reject this type. |
Add(INamedAttribute)
Adds the provided attribute to the list of accepted attributes. CADability knows the following attributes: Layer, Layer, ColorDef, LineWidth, LinePattern, DimensionStyle, HatchStyle. If you have your own attributes which are unknown to CADability, you need to override this method to handle those attributes.
Declaration
public virtual bool Add(INamedAttribute atr)
Parameters
| Type | Name | Description |
|---|---|---|
| INamedAttribute | atr | Attribute to be accepted |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if attribute was known, false otherwise |
Added(IPropertyPage)
Overrides Added(IPropertyTreeView)
Declaration
public override void Added(IPropertyPage propertyTreeView)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyPage | propertyTreeView |
Overrides
| Improve this Doc View SourceConstruct()
Constructs a ne Filter or Filter-derived object
Declaration
public static Filter Construct()
Returns
| Type | Description |
|---|---|
| Filter | The newly constructed Filter |
Contains(INamedAttribute)
Checks whether the provided attribute would be accepted
Declaration
public virtual bool Contains(INamedAttribute atr)
Parameters
| Type | Name | Description |
|---|---|---|
| INamedAttribute | atr | The attribute to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if objects with this attribute would be accepted by this filter, false otherwise |
EndEdit(Boolean, Boolean, String)
Declaration
public override void EndEdit(bool aborted, bool modified, string newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | aborted | |
| System.Boolean | modified | |
| System.String | newValue |
Overrides
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| System.Runtime.Serialization.StreamingContext | context | The destination (System.Runtime.Serialization.StreamingContext) for this serialization. |
LabelChanged(String)
Declaration
public override void LabelChanged(string NewText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | NewText |
Overrides
| Improve this Doc View SourceRemove(INamedAttribute)
Removes this attribute from the list of accepted attributes. For custom attributes see Accept(IGeoObject)
Declaration
public virtual bool Remove(INamedAttribute atr)
Parameters
| Type | Name | Description |
|---|---|---|
| INamedAttribute | atr | Attribute to be removed |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if attribute was known, false otherwise |
StartEdit(Boolean)
Declaration
public override void StartEdit(bool editValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | editValue |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceICommandHandler.OnCommand(String)
Declaration
bool ICommandHandler.OnCommand(string MenuId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | MenuId |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ICommandHandler.OnSelected(MenuWithHandler, Boolean)
Declaration
void ICommandHandler.OnSelected(MenuWithHandler selectedMenuItem, bool selected)
Parameters
| Type | Name | Description |
|---|---|---|
| MenuWithHandler | selectedMenuItem | |
| System.Boolean | selected |
ICommandHandler.OnUpdateCommand(String, CommandState)
Declaration
bool ICommandHandler.OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | MenuId | |
| CommandState | CommandState |
Returns
| Type | Description |
|---|---|
| System.Boolean |