예제 #1
0
        public static string ToLegacyType(string key, string type,
                                          out bool isKnownKey, out bool isSpecialType)
        {
            isKnownKey    = false;
            isSpecialType = false;

            key  = AsciiUtil.ToLower(key);
            type = AsciiUtil.ToLower(type);

            KeyData keyData = KEYMAP.Get(key);

            if (keyData != null)
            {
                isKnownKey = true;
                Type t = keyData.TypeMap.Get(type);
                if (t != null)
                {
                    return(t.legacyId);
                }
                if (keyData.SpecialTypes != null)
                {
                    foreach (SpecialType st in keyData.SpecialTypes)
                    {
                        if (st.GetHandler().IsWellFormed(type))
                        {
                            isSpecialType = true;
                            return(st.GetHandler().Canonicalize(type));
                        }
                    }
                }
            }
            return(null);
        }
예제 #2
0
        public static string ToLegacyKey(string key)
        {
            key = AsciiUtil.ToLower(key);
            KeyData keyData = KEYMAP.Get(key);

            if (keyData != null)
            {
                return(keyData.LegacyId);
            }
            return(null);
        }
예제 #3
0
        public static string ToBcpKey(string key)
        {
            key = AsciiUtil.ToLowerString(key);
            KeyData keyData = KEYMAP.Get(key);

            if (keyData != null)
            {
                return(keyData.BcpId);
            }
            return(null);
        }