本文整理汇总了C#中IGlyphService.GetGlyph方法的典型用法代码示例。如果您正苦于以下问题:C# IGlyphService.GetGlyph方法的具体用法?C# IGlyphService.GetGlyph怎么用?C# IGlyphService.GetGlyph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGlyphService
的用法示例。
在下文中一共展示了IGlyphService.GetGlyph方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegistryCompletionSource
public RegistryCompletionSource(ITextBuffer buffer, IGlyphService glyphService)
{
_buffer = buffer;
_versionGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.GlyphItemPublic);
_keyGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphClosedFolder, StandardGlyphItem.GlyphItemPublic);
_dataTypeGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupStruct, StandardGlyphItem.GlyphItemPublic);
}
示例2: PkgdefCompletionSource
public PkgdefCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
{
_buffer = buffer;
_classifier = classifier.GetClassifier(buffer);
_navigator = navigator;
_glyphService = glyphService;
_defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
_snippetGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphCSharpExpansion, StandardGlyphItem.GlyphItemPublic);
}
示例3: CmdCompletionSource
public CmdCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, IGlyphService glyphService, ITextStructureNavigator textStructureNavigator)
{
_buffer = buffer;
_classifier = classifier.GetClassifier(buffer);
_keywordGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic);
_environmentGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphAssembly, StandardGlyphItem.GlyphItemPublic);
_labelGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphArrow, StandardGlyphItem.GlyphItemPublic);
_textStructureNavigator = textStructureNavigator;
}
示例4: VsctCompletionSource
public VsctCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
{
_buffer = buffer;
_classifier = classifier.GetClassifier(buffer);
_navigator = navigator;
_glyphService = glyphService;
_defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
_builtInGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.TotalGlyphItems);
_imageService = ExtensibilityToolsPackage.GetGlobalService(typeof(SVsImageService)) as IVsImageService2;
}
示例5: PyCompletion
/// <summary>
/// Constructor used by IPy declarations retrieved from the IPy engine
/// </summary>
internal PyCompletion(Declaration declaration, IGlyphService glyphService)
: base(declaration.Title)
{
this.InsertionText = declaration.Title;
this.Description = declaration.Description;
this.IconSource = glyphService.GetGlyph(GetGroupFromDeclaration(declaration), GetScopeFromDeclaration(declaration));
}
示例6: JsCompletion
internal static DynamicallyVisibleCompletion JsCompletion(IGlyphService service, MemberResult memberResult, bool quote) {
return new DynamicallyVisibleCompletion(memberResult.Name,
GetInsertionQuote(quote, memberResult.Completion),
memberResult.Documentation,
service.GetGlyph(GetGlyphGroup(memberResult), StandardGlyphItem.GlyphItemPublic),
String.Empty
);
}
示例7: PythonCompletion
internal static DynamicallyVisibleCompletion PythonCompletion(IGlyphService service, MemberResult memberResult) {
return new DynamicallyVisibleCompletion(memberResult.Name,
memberResult.Completion,
() => memberResult.Documentation,
() => service.GetGlyph(memberResult.MemberType.ToGlyphGroup(), StandardGlyphItem.GlyphItemPublic),
Enum.GetName(typeof(PythonMemberType), memberResult.MemberType)
);
}
示例8: CompletionCompiler
public CompletionCompiler(IGlyphService glyphs)
{
Glyphs = glyphs;
IconMappings = new Dictionary<SassCompletionValueType, ImageSource>
{
{ SassCompletionValueType.Default, Glyphs.GetGlyph(StandardGlyphGroup.GlyphGroupUnknown, StandardGlyphItem.TotalGlyphItems) },
{ SassCompletionValueType.Keyword, Glyphs.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.TotalGlyphItems) },
{ SassCompletionValueType.SystemFunction, Glyphs.GetGlyph(StandardGlyphGroup.GlyphGroupMethod, StandardGlyphItem.GlyphItemPublic) },
{ SassCompletionValueType.UserFunction, Glyphs.GetGlyph(StandardGlyphGroup.GlyphExtensionMethod, StandardGlyphItem.GlyphItemInternal) },
{ SassCompletionValueType.Mixin, Glyphs.GetGlyph(StandardGlyphGroup.GlyphGroupInterface, StandardGlyphItem.GlyphItemInternal) },
{ SassCompletionValueType.Variable, Glyphs.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemInternal) },
{ SassCompletionValueType.Property, Glyphs.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.TotalGlyphItems) }
};
}
示例9: Initialize
public static void Initialize(IGlyphService glyphService, IIconService iconService)
{
var supportedGlyphGroups = new Dictionary<StandardGlyphGroup, string>
{
{ StandardGlyphGroup.GlyphGroupError, "Error" },
{ StandardGlyphGroup.GlyphGroupDelegate, "Delegate" },
{ StandardGlyphGroup.GlyphGroupEnum, "Enum" },
{ StandardGlyphGroup.GlyphGroupStruct, "Struct" },
{ StandardGlyphGroup.GlyphGroupClass, "Class" },
{ StandardGlyphGroup.GlyphGroupInterface, "Interface" },
{ StandardGlyphGroup.GlyphGroupModule, "Module" },
{ StandardGlyphGroup.GlyphGroupConstant, "Constant" },
{ StandardGlyphGroup.GlyphGroupEnumMember, "EnumMember" },
{ StandardGlyphGroup.GlyphGroupEvent, "Event" },
{ StandardGlyphGroup.GlyphExtensionMethodPrivate, "ExtensionMethodPrivate" },
{ StandardGlyphGroup.GlyphExtensionMethodProtected, "ExtensionMethodProtected" },
{ StandardGlyphGroup.GlyphExtensionMethodInternal, "ExtensionMethodInternal" },
{ StandardGlyphGroup.GlyphExtensionMethod, "ExtensionMethod" },
{ StandardGlyphGroup.GlyphGroupMethod, "Method" },
{ StandardGlyphGroup.GlyphGroupProperty, "Property" },
{ StandardGlyphGroup.GlyphGroupField, "Field" },
{ StandardGlyphGroup.GlyphGroupOperator, "Operator" },
{ StandardGlyphGroup.GlyphReference, "Reference" }
};
var supportedGlyphItems = new Dictionary<StandardGlyphItem, string>
{
{ StandardGlyphItem.GlyphItemPrivate, "Private" },
{ StandardGlyphItem.GlyphItemProtected, "Protected" },
{ StandardGlyphItem.GlyphItemInternal, "Internal" },
{ StandardGlyphItem.GlyphItemPublic, "Public" },
{ StandardGlyphItem.GlyphItemFriend, "Friend" }
};
foreach (var groupKvp in supportedGlyphGroups)
{
foreach (var itemKvp in supportedGlyphItems)
{
string iconName = GetIconName(groupKvp.Value, itemKvp.Value);
StandardGlyphGroup localGroup = groupKvp.Key;
StandardGlyphItem localItem = itemKvp.Key;
iconService.AddIcon(iconName, iconName, () => glyphService.GetGlyph(localGroup, localItem));
}
}
}
示例10: PythonCompletion
internal static Completion PythonCompletion(IGlyphService service, MemberResult memberResult)
{
StandardGlyphGroup group = memberResult.MemberType.ToGlyphGroup();
var icon = new IconDescription(group, StandardGlyphItem.GlyphItemPublic);
var result = new LazyCompletion(memberResult.Name, () => memberResult.Completion, () => memberResult.ToolTip, service.GetGlyph(group, StandardGlyphItem.GlyphItemPublic));
result.Properties.AddProperty(typeof(IconDescription), icon);
return result;
}
示例11: GetIconSource
private ImageSource GetIconSource(IGlyphService glyphService, SpringCompletionType type)
{
switch (type)
{
case SpringCompletionType.Namespace:
case SpringCompletionType.Class:
case SpringCompletionType.Interface:
case SpringCompletionType.Property:
case SpringCompletionType.ConstructorArg:
case SpringCompletionType.EnumMember:
case SpringCompletionType.Boolean:
return glyphService.GetGlyph(GetGroupFromDeclaration(type), GetScopeFromDeclaration(type));
case SpringCompletionType.Snippet:
case SpringCompletionType.Alias:
return SpringLeafGlyph;
default:
return glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupClass, StandardGlyphItem.GlyphItemPublic);
}
}
示例12: GetCompletions
public IEnumerable<Completion> GetCompletions(ITextBuffer buffer, SnapshotSpan span, IGlyphService glyphService)
{
var semanticModel = GetSemanticModel(buffer);
var identifiers = semanticModel.GetIdentifiers(span.Start);
var contextSpan = semanticModel.GetContextSpan(span.Start);
var prefix = contextSpan.Type == ContextType.Template ? "$" : "";
return identifiers.Select(i =>
{
var imageSource = glyphService.GetGlyph(i.Glyph, StandardGlyphItem.GlyphItemPublic);
var quickInfo = i.IsParent ? i.QuickInfo.Replace("$parent", contextSpan.ParentContext?.Name.ToLowerInvariant()) : i.QuickInfo;
return new Completion(prefix + i.Name, prefix + i.Name, quickInfo, imageSource, null);
});
}
示例13: GetImageSource
public static ImageSource GetImageSource(this Glyph glyph, IGlyphService glyphService)
{
return glyphService.GetGlyph(glyph.GetStandardGlyphGroup(), glyph.GetStandardGlyphItem());
}
示例14: PaketCompletionSource
public PaketCompletionSource(IGlyphService glyphService, ITextBuffer textBuffer, ITextStructureNavigator navigator)
{
this.textBuffer = textBuffer;
this.navigator = navigator;
glyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic);
}
示例15: GetCompletions
public IEnumerable<Completion> GetCompletions(ITextBuffer buffer, SnapshotSpan span, IGlyphService glyphService)
{
var semanticModel = GetSemanticModel(buffer);
var identifiers = semanticModel.GetIdentifiers(span.Start);
var contextSpan = semanticModel.GetContextSpan(span.Start);
var prefix = contextSpan.Type == ContextType.Template ? "$" : "";
var completions = identifiers.Select(i =>
{
var imageSource = glyphService.GetGlyph(i.Glyph, StandardGlyphItem.GlyphItemPublic);
var quickInfo = i.IsParent ? i.QuickInfo.Replace("Item", contextSpan.ParentContext?.Name) : i.QuickInfo;
return new Completion(prefix + i.Name, prefix + i.Name, quickInfo, imageSource, null);
});
if (contextSpan.Type == ContextType.Template && contextSpan.Context.Name == nameof(File))
{
var imageSource = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.GlyphItemPublic);
var codeBlock = new[]
{
new Completion("${ }", "${\r\n}", "Insert a custom C# code block.", imageSource, null)
};
return codeBlock.Concat(completions);
}
return completions;
}