// Done! public void BringToFront(MapNode node) { var list = new ConcreteMap(); for (int i = 0; i < this.Count; ++i) { if (this[i] != node) { list.Add(this[i]); } } list.Add(node); this.Clear(); for (int i = 0; i < list.Count; ++i) { this.Add(list[i]); } }
// Done! public void SendToBack(MapNode node) { var list = new ConcreteMap { node }; for (int i = 0; i < this.Count; ++i) { if (this[i] != node) { list.Add(this[i]); } } this.Clear(); for (int i = 0; i < list.Count; ++i) { this.Add(list[i]); } }