public void SetLock(params string[] args) { Lock.Clear(); for (int i = 0; i < args.Length; i++) { int p; if (int.TryParse(args[i], out p)) { Lock.Add((PacketTypes)p); } } }