本文整理汇总了C#中IReflectClass.IsArray方法的典型用法代码示例。如果您正苦于以下问题:C# IReflectClass.IsArray方法的具体用法?C# IReflectClass.IsArray怎么用?C# IReflectClass.IsArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReflectClass
的用法示例。
在下文中一共展示了IReflectClass.IsArray方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetComponentType
public virtual IReflectClass GetComponentType(IReflectClass a_class)
{
while (a_class.IsArray())
{
a_class = a_class.GetComponentType();
}
return a_class;
}
示例2: NameOf
private static TypeName NameOf(IReflectClass typeToFind)
{
var name = TypeNameParser.ParseString(typeToFind.GetName());
if (typeToFind.IsArray() && !name.ArrayOf.HasValue)
{
return TypeName.CreateArrayOf(name, 1);
}
return name;
}
示例3: CollectKnownClass
private void CollectKnownClass(Collection4 classes, IReflectClass clazz)
{
if (IsInternalClass(clazz))
{
return;
}
if (!HasIdentity(clazz))
{
return;
}
if (clazz.IsArray())
{
return;
}
classes.Add(clazz);
}
示例4: BaseType
public static IReflectClass BaseType(IReflectClass clazz)
{
if (clazz == null)
{
return null;
}
if (clazz.IsArray())
{
return BaseType(clazz.GetComponentType());
}
return clazz;
}
示例5: TypeHandlerForClass
public ITypeHandler4 TypeHandlerForClass(IReflectClass clazz)
{
if (clazz == null)
{
return null;
}
if (clazz.IsArray())
{
if (IsNDimensional(clazz))
{
return _openMultiDimensionalArrayHandler;
}
return _openArrayHandler;
}
ITypeHandler4 cachedTypeHandler = (ITypeHandler4)_mapReflectorToTypeHandler.Get(clazz
);
if (cachedTypeHandler != null)
{
return cachedTypeHandler;
}
ITypeHandler4 configuredTypeHandler = ConfiguredTypeHandler(clazz);
if (Handlers4.IsValueType(configuredTypeHandler))
{
return configuredTypeHandler;
}
return null;
}
示例6: OpenArrayHandler
public ITypeHandler4 OpenArrayHandler(IReflectClass clazz)
{
if (clazz.IsArray())
{
if (IsNDimensional(clazz))
{
return _openMultiDimensionalArrayHandler;
}
return _openArrayHandler;
}
return null;
}
示例7: ClassMetadataForClass
internal ClassMetadata ClassMetadataForClass(IReflectClass clazz)
{
if (clazz == null)
{
return null;
}
if (clazz.IsArray())
{
return IsNDimensional(clazz) ? _untypedMultiDimensionalMetadata : _untypedArrayMetadata;
}
return (ClassMetadata)_mapReflectorToClassMetadata.Get(clazz);
}
示例8: IsValueTypeOrArrayOfValueType
protected virtual bool IsValueTypeOrArrayOfValueType(IReflectClass claxx)
{
// TODO Optimization: Compute this lazily in ReflectClass;
if (_reflector.IsValueType(claxx))
{
return true;
}
return claxx.IsArray() && _reflector.IsValueType(claxx.GetComponentType());
}
示例9: IsCollection
public virtual bool IsCollection(IReflectClass candidate)
{
if (candidate.IsArray())
{
return false;
}
NetClass netClass = candidate as NetClass;
if (null == netClass)
{
return false;
}
return typeof(System.Collections.ICollection).IsAssignableFrom(netClass.GetNetType());
}
示例10: Configure
internal virtual void Configure(IReflectClass clazz, bool isPrimitive)
{
_isArray = clazz.IsArray();
if (_isArray)
{
IReflectArray reflectArray = Reflector().Array();
_isNArray = reflectArray.IsNDimensional(clazz);
_isPrimitive = reflectArray.GetComponentType(clazz).IsPrimitive();
}
else
{
_isPrimitive = isPrimitive | clazz.IsPrimitive();
}
}