本文整理汇总了C#中IType.IsString方法的典型用法代码示例。如果您正苦于以下问题:C# IType.IsString方法的具体用法?C# IType.IsString怎么用?C# IType.IsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IType
的用法示例。
在下文中一共展示了IType.IsString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasCorrectType
private bool HasCorrectType(PredefinedType predefinedType, IType type)
{
var typeConversionRule = myOwnerDeclaration.GetTypeConversionRule();
if (type.IsString() || !type.IsSubtypeOf(predefinedType.IEnumerable))
return false;
var parameterDeclaration = myOwnerDeclaration as IRegularParameterDeclaration;
if (parameterDeclaration != null)
return CheckSingleType(predefinedType, myOwnerDeclaration.GetPsiModule(), type, typeConversionRule, parameterDeclaration.Type);
var methodDeclaration = myOwnerDeclaration as IMethodDeclaration;
if (methodDeclaration != null && methodDeclaration.ParameterDeclarations.Count == 1)
return CheckSingleType(predefinedType, myOwnerDeclaration.GetPsiModule(), type, typeConversionRule, methodDeclaration.ParameterDeclarations[0].Type);
return true;
}
示例2: IsArgumentTypeTheExpected
protected override bool IsArgumentTypeTheExpected(IType type)
{
IDeclaredType declaredType;
return type != null && (type.IsString() || ((declaredType = type.GetScalarType()) != null && declaredType.GetClrName().FullName == "System.Guid"));
}
示例3: IsAvailableForType
protected override bool IsAvailableForType(IType type) => type.IsString();
示例4: IsArgumentTypeTheExpected
protected override bool IsArgumentTypeTheExpected(IType type)
{
return type != null && (type.Classify == TypeClassification.REFERENCE_TYPE || type.IsNullable())
&& !(type is IArrayType || type.IsString());
}
示例5: IsArgumentTypeTheExpected
protected override bool IsArgumentTypeTheExpected(IType type)
{
return type != null && type.IsString();
}
示例6: IsArgumentTypeTheExpected
protected override bool IsArgumentTypeTheExpected(IType type)
{
// NOTE: type.IsArray() is false, I don't know why.
return type != null && type is IArrayType && !type.IsString();
}