本文整理汇总了C#中System.Reflection.MemberInfo.GetUpperBound方法的典型用法代码示例。如果您正苦于以下问题:C# MemberInfo.GetUpperBound方法的具体用法?C# MemberInfo.GetUpperBound怎么用?C# MemberInfo.GetUpperBound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.MemberInfo
的用法示例。
在下文中一共展示了MemberInfo.GetUpperBound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MemberIsField
private static bool MemberIsField(MemberInfo[] mi)
{
int upperBound = mi.GetUpperBound(0);
for (int i = 0; i <= upperBound; i++)
{
info = mi[i];
if ((info != null) && (info.MemberType == MemberTypes.Field))
{
int num4 = mi.GetUpperBound(0);
for (int j = 0; j <= num4; j++)
{
if (((i != j) && (mi[j] != null)) && info.DeclaringType.IsSubclassOf(mi[j].DeclaringType))
{
mi[j] = null;
}
}
}
}
foreach (MemberInfo info in mi)
{
if ((info != null) && (info.MemberType != MemberTypes.Field))
{
return false;
}
}
return true;
}
示例2: GetNonGenericMembers
internal static MemberInfo[] GetNonGenericMembers(MemberInfo[] Members)
{
if ((Members != null) && (Members.Length > 0))
{
int num = 0;
int upperBound = Members.GetUpperBound(0);
for (int i = 0; i <= upperBound; i++)
{
if (LegacyIsGeneric(Members[i]))
{
Members[i] = null;
}
else
{
num++;
}
}
if (num == (Members.GetUpperBound(0) + 1))
{
return Members;
}
if (num > 0)
{
MemberInfo[] infoArray2 = new MemberInfo[(num - 1) + 1];
int index = 0;
int num6 = Members.GetUpperBound(0);
for (int j = 0; j <= num6; j++)
{
if (Members[j] != null)
{
infoArray2[index] = Members[j];
index++;
}
}
return infoArray2;
}
}
return null;
}