pGina.Plugin.UsernameMod.Rules.ListOfRules.MoveDown C# (CSharp) Метод

MoveDown() публичный Метод

Moves the rule at the specified index down one (e.g. index=2 becomes index=3). Will not move an item if it's at the bottom, or if it will be below a rule with a later step. (e.g. An authorization rule will not move below a gateway rule)
public MoveDown ( int index ) : bool
index int
Результат bool
        public bool MoveDown(int index)
        {
            IUsernameRule rule = list.ElementAt(index);
            if (index < list.Count - 1)
            {
                if (list.ElementAt(index + 1).stage == rule.stage)
                {
                    list.RemoveAt(index);
                    list.Insert(index + 1, rule);
                    return true;
                }
            }
            return false;
        }