本文整理匯總了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;
}
}
}
}