Show / Hide Table of Contents

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 to decide, whether an object may be selected or not. Filters may also be used for other purposes. In this standard implementation the attributes of a IGeoObject and the type of the object are used to accept or reject an object. You may derive a class from this Filter class and handle the static Constructor delegate by constructing your own filter. In your derived class you can use any criteria of a IGeoObject for filtering, e.g. the contents of UserData.

Inheritance
System.Object
IShowPropertyImpl
Filter
Implements
IShowProperty
IPropertyEntry
System.Runtime.Serialization.ISerializable
ICommandHandler
Inherited Members
IShowPropertyImpl.propertyTreeView
IShowPropertyImpl.labelText
IShowPropertyImpl.resourceId
IShowPropertyImpl.flagsToSuppress
IShowPropertyImpl.SuppressFlags(ShowPropertyLabelFlags)
IShowPropertyImpl.Frame
IShowPropertyImpl.IShowProperty.Added(IPropertyTreeView)
IShowPropertyImpl.Added(IPropertyTreeView)
IShowPropertyImpl.Selected()
IShowPropertyImpl.UnSelected()
IShowPropertyImpl.ChildSelected(IShowProperty)
IShowPropertyImpl.Opened(Boolean)
IShowPropertyImpl.Removed(IPropertyTreeView)
IShowPropertyImpl.ShowOpen(Boolean)
IShowPropertyImpl.Select()
IShowPropertyImpl.InfoText
IShowPropertyImpl.HelpLink
IShowPropertyImpl.OwnerDrawHeight
IShowPropertyImpl.IShowProperty.SetTabIndex(Int32)
IShowPropertyImpl.StateChangedEvent
IShowPropertyImpl.SetFocus()
IShowPropertyImpl.Hidden
IShowPropertyImpl.ReadOnly
IShowPropertyImpl.Refresh()
IShowPropertyImpl.OnEnterPressed()
IShowPropertyImpl.OnVisibilityChanged(Boolean)
IShowPropertyImpl.IsSelected
IShowPropertyImpl.Concat(IShowProperty[], IShowProperty[])
IShowPropertyImpl.Update(IShowProperty)
IShowPropertyImpl.SelectedBckgColor
IShowPropertyImpl.SelectedTextColor
IShowPropertyImpl.UnselectedBckgColor
IShowPropertyImpl.UnselectedTextColor
IShowPropertyImpl.IPropertyEntry.IsOpen
IShowPropertyImpl.HasDropDownButton
IShowPropertyImpl.ValueIsEditable
IShowPropertyImpl.Flags
IShowPropertyImpl.Label
IShowPropertyImpl.Value
IShowPropertyImpl.ResourceId
IShowPropertyImpl.Parent
IShowPropertyImpl.SubItems
IShowPropertyImpl.ButtonClicked(PropertyEntryButton)
IShowPropertyImpl.OpenOrCloseSubEntries()
IShowPropertyImpl.propertyPage
IShowPropertyImpl.Removed(IPropertyPage)
IShowPropertyImpl.GetDropDownList()
IShowPropertyImpl.EditTextChanged(String)
IShowPropertyImpl.IPropertyEntry.Index
IShowPropertyImpl.IPropertyEntry.IndentLevel
IShowPropertyImpl.Selected(IPropertyEntry)
IShowPropertyImpl.UnSelected(IPropertyEntry)
IShowPropertyImpl.ListBoxSelected(Int32)
IShowPropertyImpl.DeferUpdate
IShowPropertyImpl.PropertyEntryChangedStateEvent
IShowPropertyImpl.PropertyEntryChangedState(StateChangedArgs)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability.Attribute
Assembly: CADability.dll
Syntax
[Serializable]
public class Filter : IShowPropertyImpl, IShowProperty, IPropertyEntry, ISerializable, ICommandHandler

Constructors

| Improve this Doc View Source

Filter()

Constructs an empty filter which accepts everything

Declaration
protected Filter()
| Improve this Doc View Source

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 Source

Constructor

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 Source

ContextMenu

Declaration
public override MenuWithHandler[] ContextMenu { get; }
Property Value
Type Description
MenuWithHandler[]
Overrides
IShowPropertyImpl.ContextMenu
| Improve this Doc View Source

EntryType

Overrides EntryType, returns GroupTitle.

Declaration
public override ShowPropertyEntryType EntryType { get; }
Property Value
Type Description
ShowPropertyEntryType
Overrides
IShowPropertyImpl.EntryType
| Improve this Doc View Source

IsActive

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
| Improve this Doc View Source

LabelText

Declaration
public override string LabelText { get; set; }
Property Value
Type Description
System.String
Overrides
IShowPropertyImpl.LabelText
| Improve this Doc View Source

LabelType

Overrides LabelType

Declaration
public override ShowPropertyLabelFlags LabelType { get; }
Property Value
Type Description
ShowPropertyLabelFlags
Overrides
IShowPropertyImpl.LabelType
| Improve this Doc View Source

Name

Name of the Filter

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SubEntries

Overrides SubEntries, returns the subentries in this property view.

Declaration
public override IShowProperty[] SubEntries { get; }
Property Value
Type Description
IShowProperty[]
Overrides
IShowPropertyImpl.SubEntries
| Improve this Doc View Source

SubEntriesCount

Overrides SubEntriesCount, returns the number of subentries in this property view.

Declaration
public override int SubEntriesCount { get; }
Property Value
Type Description
System.Int32
Overrides
IShowPropertyImpl.SubEntriesCount

Methods

| Improve this Doc View Source

Accept(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

| Improve this Doc View Source

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.

| Improve this Doc View Source

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

| Improve this Doc View Source

Added(IPropertyPage)

Overrides Added(IPropertyTreeView)

Declaration
public override void Added(IPropertyPage propertyTreeView)
Parameters
Type Name Description
IPropertyPage propertyTreeView
Overrides
IShowPropertyImpl.Added(IPropertyPage)
| Improve this Doc View Source

Construct()

Constructs a ne Filter or Filter-derived object

Declaration
public static Filter Construct()
Returns
Type Description
Filter

The newly constructed Filter

| Improve this Doc View Source

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

| Improve this Doc View Source

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
IShowPropertyImpl.EndEdit(Boolean, Boolean, String)
| Improve this Doc View Source

GetObjectData(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.

| Improve this Doc View Source

LabelChanged(String)

Declaration
public override void LabelChanged(string NewText)
Parameters
Type Name Description
System.String NewText
Overrides
IShowPropertyImpl.LabelChanged(String)
| Improve this Doc View Source

Remove(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

| Improve this Doc View Source

StartEdit(Boolean)

Declaration
public override void StartEdit(bool editValue)
Parameters
Type Name Description
System.Boolean editValue
Overrides
IShowPropertyImpl.StartEdit(Boolean)

Explicit Interface Implementations

| Improve this Doc View Source

ICommandHandler.OnCommand(String)

Declaration
bool ICommandHandler.OnCommand(string MenuId)
Parameters
Type Name Description
System.String MenuId
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ICommandHandler.OnSelected(MenuWithHandler, Boolean)

Declaration
void ICommandHandler.OnSelected(MenuWithHandler selectedMenuItem, bool selected)
Parameters
Type Name Description
MenuWithHandler selectedMenuItem
System.Boolean selected
| Improve this Doc View Source

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

Implements

IShowProperty
IPropertyEntry
System.Runtime.Serialization.ISerializable
ICommandHandler
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX