C#Type类字段问题 急 急 急!!!
在这个程序中:using System;
using System.Reflection;
using System.Security;
public class MyFilterAttributeSample
{
public static void Main()
{
try
{
MemberFilter myFilter = Type.FilterAttribute;
Type myType = typeof(System.String);
MemberInfo[] myMemberInfoArray = myType.FindMembers(MemberTypes.Constructor
|MemberTypes.Method, BindingFlags.Public | BindingFlags.Static |
BindingFlags.Instance, myFilter, MethodAttributes.SpecialName);
foreach (MemberInfo myMemberinfo in myMemberInfoArray)
{
Console.Write ("\n" + myMemberinfo.Name);
Console.Write (" is a " + myMemberinfo.MemberType.ToString());
}
}
catch(ArgumentNullException e)
{
Console.Write("ArgumentNullException : " + e.Message);
}
catch(SecurityException e)
{
Console.Write("SecurityException : " + e.Message);
}
catch(Exception e)
{
Console.Write("Exception :" + e.Message);
}
}
}
请问:
1,MemberFilter myFilter = Type.FilterAttribute;中FilterAttribute是字段,myFilter 是委托实例 字段怎么能赋予委托实例呢? msdn是这样解释的:此字段含有对 FindMembers 方法使用的委托的引用
2,MemberFilter myFilter = Type.FilterAttribute;
Type myType = typeof(System.String);
MemberInfo[] myMemberInfoArray = myType.FindMembers(MemberTypes.Constructor
|MemberTypes.Method, BindingFlags.Public | BindingFlags.Static |
BindingFlags.Instance, myFilter, MethodAttributes.SpecialName);
能解释一下这段吗 越详细越好
谢谢 急 急 急!!!