コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
 public static ProtocolFormat GetProtocolFormat()
 {
     return(SeparatorResourceManager.GetInstance().protocolFormat);
 }
コード例 #3
0
 public static void SetProtocolFormat(ProtocolFormat type)
 {
     SeparatorResourceManager.GetInstance().protocolFormat = type;
 }
コード例 #4
0
 public static string GetErrorMessageString(string key)
 {
     return(SeparatorResourceManager.GetInstance().LookupErrorMessageString(key));
 }
コード例 #5
0
 public static Font GetFont(FontId lookupKey)
 {
     return(SeparatorResourceManager.GetInstance().LookupFont(lookupKey));
 }
コード例 #6
0
 public static string GetSeparatorString(StringId lookupKey)
 {
     return(SeparatorResourceManager.GetInstance().
            LookupSeparatorResourceString(lookupKey));
 }
コード例 #7
0
        // 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);
        }