本文整理汇总了C#中INamespaceSymbol.ToDisplayString方法的典型用法代码示例。如果您正苦于以下问题:C# INamespaceSymbol.ToDisplayString方法的具体用法?C# INamespaceSymbol.ToDisplayString怎么用?C# INamespaceSymbol.ToDisplayString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INamespaceSymbol
的用法示例。
在下文中一共展示了INamespaceSymbol.ToDisplayString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParsedNamespace
private SDNamespace GetParsedNamespace(INamespaceSymbol namespaceSymbol)
{
var descriptionFiles = _descriptionFiles.Where(d => Path.GetFileName(d).ToLower().Contains(namespaceSymbol.ToDisplayString().ToLower() + ".sdnd"));
var descriptions = new SDLanguageItemCollection<SDTemplate>();
foreach (var file in descriptionFiles)
{
if (!string.IsNullOrEmpty(namespaceSymbol.ToDisplayString().Trim()))
{
var splitted = Path.GetFileName(file).ToLower().Replace(namespaceSymbol.ToDisplayString().ToLower(), " ").Split('.');
if (splitted.Length > 0 && splitted[0].Length == 2 && CultureInfo.GetCultures(CultureTypes.AllCultures).Any(c => c.TwoLetterISOLanguageName == splitted[0]))
{
descriptions.Add(splitted[0], new SDTemplate(File.ReadAllText(file), ParserOptions.Tokens));
ExecuteOnDocLanguageFound(splitted[0].ToLower());
}
else if (splitted.Length > 0 && string.IsNullOrEmpty(splitted[0].Trim()))
{
descriptions.Add("default", new SDTemplate(File.ReadAllText(file), ParserOptions.Tokens));
}
}
}
return new SDNamespace(namespaceSymbol.GetIdentifier())
{
Assemblyname = namespaceSymbol.ContainingAssembly.Name,
Descriptions = descriptions
};
}
示例2: AddNamespaceLink
protected void AddNamespaceLink(INamespaceSymbol namespaceSymbol)
{
if (namespaceSymbol.IsGlobalNamespace)
{
return;
}
var text = namespaceSymbol.ToDisplayString();
var navInfo = _libraryManager.GetNamespaceNavInfo(namespaceSymbol, _project, GetCompilation(), useExpandedHierarchy: false);
_description.AddDescriptionText3(text, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
}
示例3: GetIdForNamespaceAsync
internal static async Task<GraphNodeId> GetIdForNamespaceAsync(INamespaceSymbol symbol, Solution solution, CancellationToken cancellationToken)
{
CodeQualifiedIdentifierBuilder builder = new CodeQualifiedIdentifierBuilder();
var assembly = await GetAssemblyFullPathAsync(symbol, solution, cancellationToken).ConfigureAwait(false);
if (assembly != null)
{
builder.Assembly = assembly;
}
builder.Namespace = symbol.ToDisplayString();
return builder.ToQualifiedIdentifier();
}
示例4: AddNamespacesFromCompilation
private static void AddNamespacesFromCompilation(ConcurrentBag<string> namespaceNamesInCompilation, INamespaceSymbol @namespace)
{
namespaceNamesInCompilation.Add(@namespace.ToDisplayString());
foreach (INamespaceSymbol namespaceMember in @namespace.GetNamespaceMembers())
{
AddNamespacesFromCompilation(namespaceNamesInCompilation, namespaceMember);
}
}
示例5: BuildNamespaceDeclaration
protected override void BuildNamespaceDeclaration(INamespaceSymbol namespaceSymbol, _VSOBJDESCOPTIONS options)
{
AddText("namespace ");
AddName(namespaceSymbol.ToDisplayString());
}
示例6: GetNamespaceName
private static string GetNamespaceName(INamespaceSymbol namespaceSymbol)
{
if (namespaceSymbol == null)
{
return string.Empty;
}
return !namespaceSymbol.IsGlobalNamespace
? namespaceSymbol.ToDisplayString()
: string.Empty;
}
示例7: GetTooltipForNamespace
private string GetTooltipForNamespace(INamespaceSymbol namespaceSymbol)
=> namespaceSymbol.ToDisplayString();