Esempio n. 1
0
        public static int GetKeyByWord(string keyWord)
        {
            ItemResource ir = null;

            if (_instance != null)
            {
                _instance._strToString.TryGetValue(keyWord, out ir);
            }
            return((ir == null) ? -1 : ir.Key);
        }
Esempio n. 2
0
        public static string Item(string key)
        {
            ItemResource ir = null;

            if (_instance != null)
            {
                _instance._strToString.TryGetValue(key, out ir);
            }
            return((ir == null) ? null : ir.Value);
        }
Esempio n. 3
0
        private void AddArrayItems(ItemResource[] resources)
        {
            if (resources != null)
            {
                foreach (ItemResource ir in resources)
                {
            #if DEBUG
                    if (_intToString.ContainsKey(ir.Key)) throw new Exception("Key exists - " + ir.Key.ToString());
            #endif

                    _intToString[ir.Key] = ir;

                    if (ir.KeyWord != null && ir.KeyWord.Length != 0)
                    {
            #if DEBUG
                        if (_strToString.ContainsKey(ir.KeyWord)) throw new Exception("KeyWord exists - " + ir.KeyWord);
            #endif

                        _strToString[ir.KeyWord] = ir;
                    }
                }
            }
        }