本文整理汇总了C#中java.lang.Class.isAssignableFrom方法的典型用法代码示例。如果您正苦于以下问题:C# Class.isAssignableFrom方法的具体用法?C# Class.isAssignableFrom怎么用?C# Class.isAssignableFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.Class
的用法示例。
在下文中一共展示了Class.isAssignableFrom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: producesType
public virtual bool producesType(Class type)
{
return this.getParameterTypes().Length == 0 && type.isAssignableFrom(this.fMethod.getReturnType());
}
示例2: getEntitiesOfTypeWithinAAAB
public virtual void getEntitiesOfTypeWithinAAAB(Class class1, AxisAlignedBB axisalignedbb, List list)
{
int i = MathHelper.floor_double((axisalignedbb.minY - 2D)/16D);
int j = MathHelper.floor_double((axisalignedbb.maxY + 2D)/16D);
if (i < 0)
{
i = 0;
}
if (j >= entities.Length)
{
j = entities.Length - 1;
}
for (int k = i; k <= j; k++)
{
List list1 = entities[k];
for (int l = 0; l < list1.size(); l++)
{
var entity = (Entity) list1.get(l);
if (class1.isAssignableFrom(entity.GetType()) && entity.boundingBox.intersectsWith(axisalignedbb))
{
list.add(entity);
}
}
}
}
示例3: countEntities
public virtual int countEntities(Class class1)
{
int i = 0;
for (int j = 0; j < loadedEntityList.size(); j++)
{
var entity = (Entity) loadedEntityList.get(j);
if (class1.isAssignableFrom(entity.GetType()))
{
i++;
}
}
return i;
}
示例4: loadAndInstantiate
public static object loadAndInstantiate(string className, Class source, Class type)
{
object obj;
try
{
Class @class = ObjectUtilities.getClassLoader(source).loadClass(className);
if (type.isAssignableFrom(@class))
obj = @class.newInstance(ObjectUtilities.__\u003CGetCallerID\u003E());
else
goto label_6;
}
catch (Exception ex)
{
int num = 2;
if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num) == null)
throw;
else
goto label_5;
}
return obj;
label_5:
return (object) null;
label_6:
return (object) null;
}