Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 4253d82

Browse files
committed
Merge pull request #44 from ItsMeSousuke/master
add MetroUI support
2 parents b32c1e2 + 1d8a3ae commit 4253d82

File tree

514 files changed

+1574
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

514 files changed

+1574
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.ComponentModel.Composition;
3+
using System.IO;
4+
using System.Text.RegularExpressions;
5+
using System.Windows.Media;
6+
using System.Windows.Media.Imaging;
7+
using Microsoft.CSS.Editor.Completion;
8+
using Microsoft.VisualStudio.Utilities;
9+
10+
namespace Glyphfriend.GlyphCompletionProviders
11+
{
12+
[Export(typeof(ICssCompletionEntryGlyphProvider))]
13+
[Name("MetroUI Font")]
14+
class MetroUIGlyphCompletionProvider : ICssCompletionEntryGlyphProvider
15+
{
16+
// Define a Regular Expression check for matches from this library
17+
private static Regex _regex = new Regex(@"^metro-icons(\.min)?\.css$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
18+
// Store the Glyph folder related to this library
19+
private static string _lib = "MetroUI";
20+
21+
public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType)
22+
{
23+
// If the source Uri for the image is null, ignore it
24+
if (sourceUri == null) { return null; }
25+
// Get the file path of the source being used
26+
string filename = Path.GetFileName(sourceUri.ToString()).Trim();
27+
// Determine if this matches our filename
28+
if (_regex.IsMatch(filename) && GlyphfriendPackage.Glyphs.ContainsKey(_lib))
29+
{
30+
if (GlyphfriendPackage.Glyphs[_lib].ContainsKey(entryName))
31+
{
32+
return GlyphfriendPackage.Glyphs[_lib][entryName];
33+
}
34+
}
35+
return null;
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)