/// <summary> /// Pops off the first mode, deactivates it, and activates the next /// one. /// </summary> public void Pop() { // We don't bother if we have none if (modes.Count == 0) { return; } // Get the first one IMode mode = modes[0]; mode.Deactivate(true); modes.RemoveFirst(); // See if we have another. If we don't, then the next call // to CurrentMode will add one. if (modes.Count > 0) { modes[0].Activate(false); } }