本文整理汇总了C#中SpecialType.GetMetadataName方法的典型用法代码示例。如果您正苦于以下问题:C# SpecialType.GetMetadataName方法的具体用法?C# SpecialType.GetMetadataName怎么用?C# SpecialType.GetMetadataName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialType
的用法示例。
在下文中一共展示了SpecialType.GetMetadataName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDeclaredSpecialType
/// <summary>
/// Lookup declaration for predefined CorLib type in this Assembly.
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
/// <remarks></remarks>
internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type)
{
#if DEBUG
foreach (var module in this.Modules)
{
Debug.Assert(module.GetReferencedAssemblies().Length == 0);
}
#endif
if (_lazySpecialTypes == null || (object)_lazySpecialTypes[(int)type] == null)
{
MetadataTypeName emittedName = MetadataTypeName.FromFullName(type.GetMetadataName(), useCLSCompliantNameArityEncoding: true);
ModuleSymbol module = this.Modules[0];
NamedTypeSymbol result = module.LookupTopLevelMetadataType(ref emittedName);
if (result.Kind != SymbolKind.ErrorType && result.DeclaredAccessibility != Accessibility.Public)
{
result = new MissingMetadataTypeSymbol.TopLevel(module, ref emittedName, type);
}
RegisterDeclaredSpecialType(result);
}
return _lazySpecialTypes[(int)type];
}
示例2: GetDeclaredSpecialType
/// <summary>
/// Lookup declaration for predefined CorLib type in this Assembly.
/// </summary>
/// <returns>The symbol for the pre-defined type or an error type if the type is not defined in the core library.</returns>
internal virtual NamedTypeSymbol GetDeclaredSpecialType(SpecialType type)
{
// TODO: cache SpecialType
return CorLibrary.GetTypeByMetadataName(type.GetMetadataName());
}