System.DiDirectory___Filters





















 System {
 System;
 System.Reflection;
 System.Globalization;
[Serializable()]
internal class __Filters {










internal virtual bool FilterAttribute(MemberInfo m,Object filterCriteria)
{

(filterCriteria == null)
throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritInt"));

 (m.MemberType) 
{
 MemberTypes.Constructor:
 MemberTypes.Method: {

MethodAttributes criteria = 0;
 {
int i = (int) filterCriteria;
criteria = (MethodAttributes) i;
}
 (Exception) {
throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritInt"));
}


MethodAttributes attr;
(m.MemberType == MemberTypes.Method)
attr = ((MethodInfo) m).Attributes;

attr = ((ConstructorInfo) m).Attributes;

(((criteria & MethodAttributes.MemberAccessMask) != 0) && (attr & MethodAttributes.MemberAccessMask) != (criteria & MethodAttributes.MemberAccessMask))
 false;
(((criteria & MethodAttributes.Static) != 0) && (attr & MethodAttributes.Static) == 0)
 false;
(((criteria & MethodAttributes.Final) != 0) && (attr & MethodAttributes.Final) == 0)
 false;
(((criteria & MethodAttributes.Virtual) != 0) && (attr & MethodAttributes.Virtual) == 0)
 false;
(((criteria & MethodAttributes.Abstract) != 0) && (attr & MethodAttributes.Abstract) == 0)
 false;
(((criteria & MethodAttributes.SpecialName)  != 0) && (attr & MethodAttributes.SpecialName) == 0)
 false;
 true;
}
 MemberTypes.Field: 
{
FieldAttributes criteria = 0;
 {
int i = (int) filterCriteria;
criteria = (FieldAttributes) i;
}
 (Exception) {
throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritInt"));
}

FieldAttributes attr = ((FieldInfo) m).Attributes;
(((criteria & FieldAttributes.FieldAccessMask) != 0) && (attr & FieldAttributes.FieldAccessMask) != (criteria & FieldAttributes.FieldAccessMask))
 false;
(((criteria & FieldAttributes.Static) != 0) && (attr & FieldAttributes.Static) == 0)
 false;
(((criteria & FieldAttributes.InitOnly) != 0) && (attr & FieldAttributes.InitOnly) == 0)
 false;
(((criteria & FieldAttributes.Literal) != 0) && (attr & FieldAttributes.Literal) == 0)
 false;
(((criteria & FieldAttributes.NotSerialized) != 0) && (attr & FieldAttributes.NotSerialized) == 0)
 false;
(((criteria & FieldAttributes.PinvokeImpl) != 0) && (attr & FieldAttributes.PinvokeImpl) == 0)
 false;
 true;
}
}

 false;
}




internal virtual bool FilterName(MemberInfo m,Object filterCriteria)
{

(filterCriteria == null || !(filterCriteria is String))
throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritString"));


String str = ((String) filterCriteria);
str = str.Trim();

String name = m.Name;

(m.MemberType == MemberTypes.NestedType) 
name = name.Substring(name.LastIndexOf('+') + 1);

(str.Length > 0 && str[str.Length - 1] ==
str = str.Substring(0, str.Length - 1);
 (name.StartsWith(str));
}

 (name.Equals(str));
}




internal virtual bool FilterIgnoreCase(MemberInfo m,Object filterCriteria)
{

(filterCriteria == null || !(filterCriteria is String))
throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritString"));

String str = (String) filterCriteria;
str = str.Trim();

String name = m.Name;

(m.MemberType == MemberTypes.NestedType) 
name = name.Substring(name.LastIndexOf('+') + 1);

(str.Length > 0 && str[str.Length - 1] ==
str = str.Substring(0, str.Length - 1);
 (String.Compare(name,0,str,0,str.Length,true,CultureInfo.InvariantCulture)==0);
}

 (String.Compare(str,name, true, CultureInfo.InvariantCulture) == 0);
}
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章