public static void Add(Command command, int Perm, string desc, int number = 1) { if (Perm > 120) { return; } OtherPerms otpe = new OtherPerms(); otpe.cmd = command; otpe.Permission = Perm; otpe.Description = desc; otpe.number = number; list.Add(otpe); }
public bool CanExecute(Command cmd) { return commands.Contains(cmd); }
public bool Contains(Command cmd) { return commands.Contains(cmd); }
public void Add(Command cmd) { commands.Add(cmd); }
public bool Remove(Command cmd) { return commands.Remove(cmd); }
public static OtherPerms Find(Command cmd, int number = 1) { foreach (OtherPerms OtPe in list) { if (OtPe.cmd == cmd && OtPe.number == number) { return OtPe; } } return null; }
public static int GetPerm(Command cmd, int number = 1) { OtherPerms otpe = Find(cmd, number); return otpe.Permission; }
public static int GetMaxNumber(Command cmd) { int i = 1; bool stop = false; while (stop == false) { OtherPerms op = Find(cmd, i); if (op == null) { stop = true; } else { i++; } } return (i - 1); }