/// <summary> /// Gets font name for given <see cref="UPGlyphIcons"/> /// </summary> /// <param name="glyphicon">Glyphicon enum</param> /// <returns>Font name</returns> public static string FontNameForGlyphicons(UPGlyphIcons glyphicon) { string fontSetName; var totalStr = ((int)glyphicon).ToString("X8"); var lastChar = totalStr[totalStr.Length - 1].ToInt(); switch (lastChar) { case (int)UPGlyphIconsType.Icons: fontSetName = "GLYPHICONS-Regular"; break; case (int)UPGlyphIconsType.Halflings: fontSetName = "GLYPHICONSHalflingsSet-Regular"; break; case (int)UPGlyphIconsType.Social: fontSetName = "GLYPHICONSSocial-Regular"; break; case (int)UPGlyphIconsType.Filetypes: fontSetName = "GLYPHICONSFiletypes-Regular"; break; default: fontSetName = "GLYPHICONS-Regular"; break; } return(fontSetName); }
/// <summary> /// Gets char for given icon /// </summary> /// <param name="icon">Icon</param> /// <returns>Character</returns> public string GetCode(UPGlyphIcons icon) { string tmpString = char.ConvertFromUtf32((int)icon >> 8).ToString(); this.glyphLookup.SetObjectForKey(tmpString, icon.ToString()); return(tmpString); }