Esempio n. 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);
        }
Esempio n. 2
0
        public static string ToBcpType(string key, string type,
                                       out bool isKnownKey, out bool isSpecialType)
        {
            isKnownKey    = false;
            isSpecialType = false;

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

            if (KEYMAP.TryGetValue(key, out KeyData keyData) && keyData != null)
            {
                isKnownKey = true;
                if (keyData.TypeMap.TryGetValue(type, out Type t) && t != null)
                {
                    return(t.bcpId);
                }
                if (keyData.SpecialTypes != null)
                {
                    foreach (SpecialType st in keyData.SpecialTypes)
                    {
                        if (st.GetHandler().IsWellFormed(type))
                        {
                            isSpecialType = true;
                            return(st.GetHandler().Canonicalize(type));
                        }
                    }
                }
            }
            return(null);
        }
Esempio n. 3
0
 public static string ToLegacyKey(string key)
 {
     key = AsciiUtil.ToLower(key);
     if (KEYMAP.TryGetValue(key, out KeyData keyData) && keyData != null)
     {
         return(keyData.LegacyId);
     }
     return(null);
 }
Esempio n. 4
0
        public static string ToLegacyKey(string key)
        {
            key = AsciiUtil.ToLower(key);
            KeyData keyData = KEYMAP.Get(key);

            if (keyData != null)
            {
                return(keyData.LegacyId);
            }
            return(null);
        }
Esempio n. 5
0
        public static string ToBcpKey(string key)
        {
            key = AsciiUtil.ToLowerString(key);
            KeyData keyData = KEYMAP.Get(key);

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