本文整理汇总了C#中ITypeReference.IsTypeSpecification方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeReference.IsTypeSpecification方法的具体用法?C# ITypeReference.IsTypeSpecification怎么用?C# ITypeReference.IsTypeSpecification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeReference
的用法示例。
在下文中一共展示了ITypeReference.IsTypeSpecification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeVisualBasicImportTypeReference
private string SerializeVisualBasicImportTypeReference(ITypeReference typeReference)
{
Debug.Assert(!(typeReference is IArrayTypeReference));
Debug.Assert(!(typeReference is IPointerTypeReference));
Debug.Assert(!(typeReference is IManagedPointerTypeReference));
Debug.Assert(!typeReference.IsTypeSpecification());
var result = PooledStringBuilder.GetInstance();
ArrayBuilder<string> nestedNamesReversed;
INestedTypeReference nestedType = typeReference.AsNestedTypeReference;
if (nestedType != null)
{
nestedNamesReversed = ArrayBuilder<string>.GetInstance();
while (nestedType != null)
{
nestedNamesReversed.Add(nestedType.Name);
typeReference = nestedType.GetContainingType(_metadataWriter.Context);
nestedType = typeReference.AsNestedTypeReference;
}
}
else
{
nestedNamesReversed = null;
}
INamespaceTypeReference namespaceType = typeReference.AsNamespaceTypeReference;
Debug.Assert(namespaceType != null);
string namespaceName = namespaceType.NamespaceName;
if (namespaceName.Length != 0)
{
result.Builder.Append(namespaceName);
result.Builder.Append('.');
}
result.Builder.Append(namespaceType.Name);
if (nestedNamesReversed != null)
{
for (int i = nestedNamesReversed.Count - 1; i >= 0; i--)
{
result.Builder.Append('.');
result.Builder.Append(nestedNamesReversed[i]);
}
nestedNamesReversed.Free();
}
return result.ToStringAndFree();
}