English | 日本語
Home > Merge > Merge for Windows > Documentation Contents > Filter Object

Filter Object

This object represents a filter. A filter is a named collection of patterns, each one of which will match a filesystem item depending on its type and name.

Properties (implemented by interface IFilter)

Count

IDL [propget] HRESULT Count([out, retval] long* pValue)
.NET Int32 Count[get]
VB6 Count As Long

The number of patterns in the collection.

The property is read-only.

Item

IDL [propget] HRESULT Item([in] VARIANT index, [out, retval] IFilterPattern** pValue)
.NET FilterPattern get_Item(Object index)
VB6 Item(index As Variant) As FilterPattern

Used to obtain a copy of one of the filter’s patterns.

The property is read-only.

Arguments

Name

IDL [propget] HRESULT Name([out, retval] BSTR* pValue)
[propput] HRESULT Name([in] BSTR newValue)
.NET String Name[get, set]
VB6 Name As String

The name of the filter.

The property is read/write.

Methods

Add

IDL HRESULT Add([in] IFilterPattern* pattern, [out, retval] long* pValue)
.NET Int32 Add(FilterPattern pattern)
VB6 Add(pattern As FilterPattern) As Long

Adds a copy of the specified pattern to the collection.

Arguments

InitializeFromExcludePattern

IDL HRESULT InitializeFromExcludePattern([in] BSTR pattern)
.NET void InitializeFromExcludePattern(String pattern)
VB6 InitializeFromExcludePattern(pattern As String)

Creates a list of exclude patterns for the filter from the string argument. The string can consist of any number of semi-colon separated patterns. Each pattern can optionally be wildcarded. Patterns ending in a back-slash character are assumed to match folders instead of files.

For example, providing: *.obj;*.exe;Debug\;Release\ will cause five patterns to be added to the filter. The first pattern will cause all files and folders to be included, the second and third will then exclude files ending in .obj and .exe, and the fourth and fifth will exclude folders called Debug or Release.

Arguments

InitializeFromIncludePattern

IDL HRESULT InitializeFromIncludePattern([in] BSTR pattern)
.NET void InitializeFromIncludePattern(String pattern)
VB6 InitializeFromIncludePattern(pattern As String)

Creates a list of include patterns for the filter from the string argument. The string can consist of any number of semi-colon separated patterns. Each pattern can optionally be wildcarded. Patterns ending in a back-slash character are assumed to match folders instead of files.

For example, providing: *.gif;*.wav;Images\;Sounds\ will cause four patterns to be added to the filter. The first and second patterns will include files ending in .gif and .wav, and the third and fourth will include folders called Images and Sounds.

Arguments

Remove

IDL HRESULT Remove([in] long index)
.NET void Remove(Int32 index)
VB6 Remove(index As Long)

Removes the pattern at the specified index in the collection.

Arguments

RepositionPattern

IDL HRESULT RepositionPattern([in] long oldIndex, [in] long newIndex)
.NET void RepositionPattern(Int32 oldIndex, Int32 newIndex)
VB6 RepositionPattern(oldIndex As Long, newIndex As Long)

Moves a pattern from one index to another in the collection.

Arguments