public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) { // If the source is null or no glyphs have been loaded, ignore the request if (sourceUri == null || GlyphfriendPackage.Glyphs == null) { return(null); } // Get the file path of the source being used var filename = Path.GetFileName(Convert.ToString(sourceUri)); // Determine if the file matches this provider and we have the library loaded if (GlyphCSSDefinitionExpression.IsMatch(filename.Trim()) && GlyphfriendPackage.Glyphs.ContainsKey(Library)) { // Since the library is loaded, determine if the Glyph exists if (entryName != null && GlyphfriendPackage.Glyphs[Library].ContainsKey(entryName)) { // It does, so serve it return(GlyphfriendPackage.Glyphs[Library][entryName]); } // Otherwise attempt to see if a default icon is defined and loaded and use it if (DefaultIconClass != null && GlyphfriendPackage.Glyphs[Library].ContainsKey(DefaultIconClass)) { return(GlyphfriendPackage.Glyphs[Library][DefaultIconClass]); } } // Let Visual Studio handle this on its own return(null); }
public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) { if (sourceUri == null) { return null; } string filename = Path.GetFileName(sourceUri.ToString()).Trim(); if (_regex.IsMatch(filename)) { return _icon; } return null; }
public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) { if (sourceUri == null) { return(null); } string filename = Path.GetFileName(sourceUri.ToString()).Trim(); if (RegExp.IsMatch(filename)) { return(Icon); } return(null); }
public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) { // If the source Uri for the image is null, ignore it if (sourceUri == null) { return null; } // Get the file path of the source being used string filename = Path.GetFileName(sourceUri.ToString()).Trim(); // Determine if this matches our filename if (_regex.IsMatch(filename) && GlyphfriendPackage.Glyphs.ContainsKey(_lib)) { if (GlyphfriendPackage.Glyphs[_lib].ContainsKey(entryName)) { return GlyphfriendPackage.Glyphs[_lib][entryName]; } return GlyphfriendPackage.Glyphs[_lib]["icon-default"]; } return null; }
public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) { // If the source Uri for the image is null, ignore it if (sourceUri == null) { return(null); } // Get the file path of the source being used string filename = Path.GetFileName(sourceUri.ToString()).Trim(); // Determine if this matches our filename if (_regex.IsMatch(filename) && GlyphfriendPackage.Glyphs.ContainsKey(_lib)) { if (GlyphfriendPackage.Glyphs[_lib].ContainsKey(entryName)) { return(GlyphfriendPackage.Glyphs[_lib][entryName]); } return(GlyphfriendPackage.Glyphs[_lib]["icon-default"]); } return(null); }