public void Add(IUsernameRule rule) { //Add the rule as the last item for the gateway for (int k = 0; k < list.Count; k++) { if (rule.stage.CompareTo(list[k].stage) < 0) { list.Insert(k, rule); return; } } list.Add(rule); }