private void OnDeleteActivated(object o, EventArgs args) { // Don't remove sector if it is the only one. if (level.Sectors.Count == 1) { application.PrintStatus("A level has to have at least one sector."); return; } application.PrintStatus("Sector '" + sector.Name + "' removed."); SectorRemoveCommand command = new SectorRemoveCommand( "Removed sector", sector, level); command.OnSectorAdd += OnSectorAdd; command.OnSectorRemove += OnSectorRemove; command.Do(); UndoManager.AddCommand(command); }
private void OnDeleteActivated(object o, EventArgs args) { // Don't remove sector if it is the only one. if (level.Sectors.Count == 1){ application.PrintStatus("A level has to have at least one sector."); return; } application.PrintStatus("Sector '"+ sector.Name + "' removed."); SectorRemoveCommand command = new SectorRemoveCommand( "Removed sector", sector, level); command.OnSectorAdd += OnSectorAdd; command.OnSectorRemove += OnSectorRemove; command.Do(); UndoManager.AddCommand(command); }