private static void InitialiseFontTable() { Debug.Assert(((int)FontId.NUM_FONTS == theFontTable.GetLength(0)), "FontId.NUM_FONTS does not equal the number of fonts defined in the font table"); for (int i = 0; i < (int)FontId.NUM_FONTS; ++i) { string fontFamily = SeparatorResourceManager.GetInstance(). LookupFontFamilyString(theFontTable[i].aFontFamilyId); int fontSize = SeparatorResourceManager.GetInstance(). LookupFontSize(theFontTable[i].aFontSizeId); if (fontSize != 0) { Font separatorFont = new Font(fontFamily, fontSize); theSeparatorFonts[i] = separatorFont; } } }
public static ProtocolFormat GetProtocolFormat() { return(SeparatorResourceManager.GetInstance().protocolFormat); }
public static void SetProtocolFormat(ProtocolFormat type) { SeparatorResourceManager.GetInstance().protocolFormat = type; }
public static string GetErrorMessageString(string key) { return(SeparatorResourceManager.GetInstance().LookupErrorMessageString(key)); }
public static Font GetFont(FontId lookupKey) { return(SeparatorResourceManager.GetInstance().LookupFont(lookupKey)); }
public static string GetSeparatorString(StringId lookupKey) { return(SeparatorResourceManager.GetInstance(). LookupSeparatorResourceString(lookupKey)); }
// FUTURE: consider implementing a cache (hashtable?) based on the resource lookup // string. You'd need to flush the cache if the thread culture changed, or have the // cache as thread-local storage (and then control the 'thread caches' individually). public static void GetSeparatorStateStrings(Type resourceType, SeparatorState separatorState, out string stateName, out string stateDescription) { SeparatorResourceManager.GetInstance().LookupSeparatorStateStrings(resourceType, separatorState, out stateName, out stateDescription); }