Module.FilterTypeNameIgnoreCase 字段
一个 TypeFilter 对象,它根据名称筛选此模块中定义的类型列表。此字段不区分大小写且为只读。
**命名空间:**System.Reflection
**程序集:**mscorlib(在 mscorlib.dll 中)
语法
声明
Public Shared ReadOnly FilterTypeNameIgnoreCase As TypeFilter
用法
Dim value As TypeFilter
value = Module.FilterTypeNameIgnoreCase
public static readonly TypeFilter FilterTypeNameIgnoreCase
public:
static initonly TypeFilter^ FilterTypeNameIgnoreCase
public static final TypeFilter FilterTypeNameIgnoreCase
public static final var FilterTypeNameIgnoreCase : TypeFilter
备注
该筛选器支持尾随“*”通配符。
示例
下面的示例显示与指定的搜索条件相匹配的模块名称,不区分大小写。
Imports System
Imports System.Reflection
Namespace ReflectionModule_Examples
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = [Assembly].GetExecutingAssembly().GetModules(False)
'In a simple project with only one module, the module at index
' 0 will be the module containing these classes.
Dim myModule As [Module] = moduleArray(0)
Dim tArray() As Type
tArray = myModule.FindTypes([Module].FilterTypeNameIgnoreCase, "my*")
Dim t As Type
For Each t In tArray
Console.WriteLine("Found a module beginning with my*: {0}", t.Name)
Next t
End Sub 'Main
End Class 'MyMainClass
Class MySecondClass
End Class 'MySecondClass
'This class does not fit the filter criteria my*
Class YourClass
End Class 'YourClass
End Namespace 'ReflectionModule_Examples
using System;
using System.Reflection;
namespace ReflectionModule_Examples
{
class MyMainClass
{
static void Main()
{
Module[] moduleArray;
moduleArray = Assembly.GetExecutingAssembly().GetModules(false);
// In a simple project with only one module, the module at index
// 0 will be the module containing these classes.
Module myModule = moduleArray[0];
Type[] tArray;
tArray = myModule.FindTypes(Module.FilterTypeNameIgnoreCase, "my*");
foreach(Type t in tArray)
{
Console.WriteLine("Found a module beginning with my*: {0}", t.Name);
}
}
}
class MySecondClass
{
}
// This class does not fit the filter criteria my*.
class YourClass
{
}
}
using namespace System;
using namespace System::Reflection;
using namespace System::Collections;
public ref class MyMainClass{};
public ref class MySecondClass{};
// This class does not fit the filter criteria my*.
public ref class YourClass{};
int main()
{
array<Module^>^moduleArray;
moduleArray = Assembly::GetExecutingAssembly()->GetModules( false );
// In a simple project with only one module, the module at index
// 0 will be the module containing these classes.
Module^ myModule = moduleArray[ 0 ];
array<Type^>^tArray;
tArray = myModule->FindTypes( Module::FilterTypeNameIgnoreCase, "my*" );
IEnumerator^ myEnum = tArray->GetEnumerator();
while ( myEnum->MoveNext() )
{
Type^ t = safe_cast<Type^>(myEnum->Current);
Console::WriteLine( "Found a module beginning with my*: {0}", t->Name );
}
}
package ReflectionModule_Examples;
import System.*;
import System.Reflection.*;
class MyMainClass
{
public static void main(String[] args)
{
Module moduleArray[];
moduleArray = Assembly.GetExecutingAssembly().GetModules(false);
// In a simple project with only one module, the module at index
// 0 will be the module containing these classes.
Module myModule = (Module)moduleArray.get_Item(0);
Type tArray[];
tArray = myModule.FindTypes(Module.FilterTypeNameIgnoreCase, "my*");
for (int iCtr = 0; iCtr < tArray.length; iCtr++) {
Type t = tArray[iCtr];
Console.WriteLine("Found a module beginning with my*: {0}",
t.get_Name());
}
} //main
} //MyMainClass
class MySecondClass
{
} //MySecondClass
// This class does not fit the filter criteria my*.
class YourClass
{
} //YourClass
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0