本文整理汇总了C#中java.lang.Class.getConstructors方法的典型用法代码示例。如果您正苦于以下问题:C# Class.getConstructors方法的具体用法?C# Class.getConstructors怎么用?C# Class.getConstructors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.Class
的用法示例。
在下文中一共展示了Class.getConstructors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestClass
public TestClass(Class klass)
{
base.\u002Ector();
TestClass testClass = this;
this.fMethodsForAnnotations = (Map) new HashMap();
this.fFieldsForAnnotations = (Map) new HashMap();
this.fClass = klass;
if (klass != null && klass.getConstructors(TestClass.__\u003CGetCallerID\u003E()).Length > 1)
{
string str = "Test class can only have one constructor";
Throwable.__\u003CsuppressFillInStackTrace\u003E();
throw new IllegalArgumentException(str);
}
else
{
Iterator iterator = this.getSuperClasses(this.fClass).iterator();
label_3:
while (iterator.hasNext())
{
Class @class = (Class) iterator.next();
Method[] declaredMethods = @class.getDeclaredMethods(TestClass.__\u003CGetCallerID\u003E());
int length1 = declaredMethods.Length;
for (int index = 0; index < length1; ++index)
this.addToAnnotationLists((FrameworkMember) new FrameworkMethod(declaredMethods[index]), this.fMethodsForAnnotations);
Field[] declaredFields = @class.getDeclaredFields(TestClass.__\u003CGetCallerID\u003E());
int length2 = declaredFields.Length;
int index1 = 0;
while (true)
{
if (index1 < length2)
{
this.addToAnnotationLists((FrameworkMember) new FrameworkField(declaredFields[index1]), this.fFieldsForAnnotations);
++index1;
}
else
goto label_3;
}
}
}
}