ACR_Items.ItemModels.GetNextKey C# (CSharp) Метод

GetNextKey() публичный статический Метод

public static GetNextKey ( Dictionary models, int currentModel ) : int
models Dictionary
currentModel int
Результат int
        public static int GetNextKey(Dictionary<int, List<int>> models, int currentModel)
        {
            bool found = true;
            foreach (int key in models.Keys)
            {
                if (found) return key;
                if (key == currentModel)
                {
                    found = true;
                }
            }

            // either the current key is the last one or we hit an error. Return the first key.
            foreach (int key in models.Keys)
            {
                return key;
            }
            return -1;
        }