Exemple #1
0
        public string Translate(K key, params object[] args)
        {
            TranslatedItem <K> translatedItem = Items[key.ToInt32(null)];

            if (translatedItem != null)
            {
                return(string.Format(translatedItem.Value, args));
            }
            return(null);
        }
Exemple #2
0
        public string Translate(K key, params object[] args)
        {
            TranslatedItem <K> translatedItem = this.Items[key.ToInt32((IFormatProvider)null)];

            if (translatedItem != null)
            {
                return(string.Format(translatedItem.Value, args));
            }
            return((string)null);
        }
Exemple #3
0
        private void SortItems()
        {
            TranslatedItem <K>[] translatedItemArray = new TranslatedItem <K> [Localizer.MaxKeyValue + 1];
            if (Items != null)
            {
                foreach (TranslatedItem <K> translatedItem in Items)
                {
                    translatedItemArray[translatedItem.Key.ToInt32(null)] = translatedItem;
                }
            }

            Items = translatedItemArray;
        }
Exemple #4
0
        private void SortItems()
        {
            TranslatedItem <K>[] translatedItemArray = new TranslatedItem <K> [this.Localizer.MaxKeyValue + 1];
            if (this.Items != null)
            {
                foreach (TranslatedItem <K> translatedItem in this.Items)
                {
                    translatedItemArray[translatedItem.Key.ToInt32((IFormatProvider)null)] = translatedItem;
                }
            }

            this.Items = translatedItemArray;
        }
Exemple #5
0
        private void SortItems()
        {
            // sort items
            var sortedItems = new TranslatedItem <K> [Localizer.MaxKeyValue + 1];

            if (Items != null)
            {
                foreach (var item in Items)
                {
                    sortedItems[item.Key.ToInt32(null)] = item;
                }
            }
            Items = sortedItems;
        }