Show / Hide Table of Contents

Struct DialogFileFilter

Describes a file filter used to filter visible files/folders in a file dialog.

Implements
IEquatable<DialogFileFilter>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public struct DialogFileFilter : IEquatable<DialogFileFilter>

Constructors

DialogFileFilter(string, string)

Initializes a new instance of the DialogFileFilter struct.

Declaration
public DialogFileFilter(string name, string filter)
Parameters
Type Name Description
string name

The display name of the filter.

string filter

The filter string. Filter for format details.

Examples
new DialogFileFilter(){ Name="Images", Filter="png;jpg;jpeg" };

This creates a file filter that will match any files ending in png, jpg, or jpeg.

See Also
Name
Filter
ShowOpenDialog(WindowHandle, string, string, DialogFileFilter[], OpenDialogOptions)
ShowSaveDialog(WindowHandle, string, string, DialogFileFilter[], SaveDialogOptions)

Fields

Filter

The file extension filter. The format of this string is "ext1;ext2;ext3". Use * to match any files.

Declaration
public string Filter
Field Value
Type Description
string
Examples
new DialogFileFilter(){ Name="Images", Filter="png;jpg;jpeg" };

This creates a file filter that will match any files ending in png, jpg, or jpeg.

Name

The display name of the filter. Prohibited characters are | and \0.

Declaration
public string Name
Field Value
Type Description
string

Methods

Equals(DialogFileFilter)

Indicates whether the current object is equal to another object of the same type.

Declaration
public readonly bool Equals(DialogFileFilter other)
Parameters
Type Name Description
DialogFileFilter other

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

Declaration
public override readonly bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current instance.

Returns
Type Description
bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Overrides
ValueType.Equals(object)

GetHashCode()

Returns the hash code for this instance.

Declaration
public override readonly int GetHashCode()
Returns
Type Description
int

A 32-bit signed integer that is the hash code for this instance.

Overrides
ValueType.GetHashCode()

ToString()

Returns a string in the form "{Name} - {Filter}".

Declaration
public override readonly string ToString()
Returns
Type Description
string

The string representation.

Overrides
ValueType.ToString()

Operators

operator ==(DialogFileFilter, DialogFileFilter)

Determines whether two specified instances of DialogFileFilter are equal.

Declaration
public static bool operator ==(DialogFileFilter left, DialogFileFilter right)
Parameters
Type Name Description
DialogFileFilter left

The first dialog file filter to compare.

DialogFileFilter right

The second dialog file filter to compare.

Returns
Type Description
bool

true if left equals right; otherwise, false.

operator !=(DialogFileFilter, DialogFileFilter)

Determines whether two specified instances of DialogFileFilter are not equal.

Declaration
public static bool operator !=(DialogFileFilter left, DialogFileFilter right)
Parameters
Type Name Description
DialogFileFilter left

The first dialog file filter to compare.

DialogFileFilter right

The second dialog file filter to compare.

Returns
Type Description
bool

true if left does not equal right; otherwise, false.

Implements

IEquatable<T>
In this article
Back to top Generated by DocFX