本文整理汇总了C#中IType.GetScalarType方法的典型用法代码示例。如果您正苦于以下问题:C# IType.GetScalarType方法的具体用法?C# IType.GetScalarType怎么用?C# IType.GetScalarType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IType
的用法示例。
在下文中一共展示了IType.GetScalarType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsIObservableType
public static bool IsIObservableType(IType type)
{
var scalarType = type.GetScalarType();
if (scalarType == null)
{
return false;
}
return scalarType.GetClrName().FullName == Constants.ObservableInterfaceName;
}
示例2: HasISchedulerSuperType
public static bool HasISchedulerSuperType(IType type)
{
var scalarType = type.GetScalarType();
if (scalarType == null)
{
return false;
}
return scalarType.GetClrName().FullName == Constants.SchedulerInterfaceName ||
scalarType.GetSuperTypes().Any(HasISchedulerSuperType);
}
示例3: IsSimple
private bool IsSimple(IType type)
{
// todo fix for enum
bool isEnum = false;
IDeclaredType declaredType = type.GetScalarType();
if (declaredType != null)
{
isEnum = declaredType.GetTypeElement() is IEnum;
}
return type.IsSimplePredefined() || isEnum;
}
示例4: CheckSingleType
private static bool CheckSingleType(PredefinedType predefinedType, IPsiModule psiModule, IType type, ITypeConversionRule conversionRule, IType typeInDeclaration)
{
if (!type.IsGenericOrNonIEnumerable())
{
if (!type.IsSubtypeOf(predefinedType.Array))
return true;
IDeclaredType scalarType = type.GetScalarType();
return scalarType != null && scalarType.IsImplicitlyConvertibleTo(typeInDeclaration, conversionRule);
}
IDeclaredType ienumerableOf = CollectionTypeUtil.CreateIEnumerableOf(psiModule, typeInDeclaration);
return ienumerableOf == null || type.IsImplicitlyConvertibleTo(ienumerableOf, conversionRule);
}
示例5: IsArgumentTypeTheExpected
protected override bool IsArgumentTypeTheExpected(IType type)
{
IDeclaredType declaredType;
return type != null && (type.IsString() || ((declaredType = type.GetScalarType()) != null && declaredType.GetClrName().FullName == "System.Guid"));
}
示例6: IsPrimitiveArray
private bool IsPrimitiveArray(IType type)
{
return type.IsArray() && IsSimple(type.GetScalarType());
}
示例7: IsChildArray
private bool IsChildArray(IType type)
{
return type.IsArray() && !IsSimple(type.GetScalarType());
}