Export (0) Print
Expand All

Type.FilterNameIgnoreCase Field

Represents the case-insensitive member filter used on names. This field is read-only.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared ReadOnly FilterNameIgnoreCase As MemberFilter
'Usage
Dim value As MemberFilter 

value = Type.FilterNameIgnoreCase

This field holds a reference to the delegate used by the FindMembers method. The method encapsulated by this delegate takes two parameters: the first is a MemberInfo object and the second is an Object. The method determines whether the MemberInfo object matches the criteria specified by the Object. The Object is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported.

For example, the Object may be assigned the value "ByTe*". In that case, when the FilterName delegate is invoked, it will return true only if the method represented by the MemberInfo object has a name that begins with "byte", ignoring case.

The following example gets the MemberFilter delegate, passes it as a parameter to the FindMembers method, and displays the methods and their attributes of the String class that begin with the letter "c", disregarding the case.

Imports System
Imports System.Reflection
Imports System.Security
Imports Microsoft.VisualBasic

Public Class MyFilterNameIgnoreCaseSample
    Public Shared Sub Main()
        Try 
            Dim myFilter As MemberFilter = Type.FilterNameIgnoreCase
            Dim myType As Type = GetType(System.String)
            Dim myMemberinfo1 As MemberInfo() = myType.FindMembers(MemberTypes.Constructor Or MemberTypes.Method, BindingFlags.Public Or BindingFlags.Static Or BindingFlags.Instance, myFilter, "C*")
            Dim myMemberinfo2 As MemberInfo
            For Each myMemberinfo2 In myMemberinfo1
                Console.Write((ControlChars.NewLine + myMemberinfo2.Name))
                Dim Mymembertypes As MemberTypes = myMemberinfo2.MemberType
                Console.WriteLine((" is a " + Mymembertypes.ToString()))
            Next myMemberinfo2
        Catch e As ArgumentNullException
            Console.Write("ArgumentNullException : " + e.Message.Tostring())
        Catch e As SecurityException
            Console.Write("SecurityException : " + e.Message.Tostring())
        Catch e As Exception
            Console.Write("Exception : " + e.Message.Tostring())
        End Try 
    End Sub 'Main
End Class 'MyFilterNameIgnoreCaseSample

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft