private void OnCreateNew(object o, EventArgs args) { try { Sector sector = LevelUtil.CreateSector("NewSector"); SectorAddCommand command = new SectorAddCommand( "Added sector", sector, level); command.OnSectorAdd += OnSectorAdd; command.OnSectorRemove += OnSectorRemove; command.Do(); UndoManager.AddCommand(command); OnSectorChanged(level, sector); OnPropertiesActivated(null, null); } catch (Exception e) { ErrorDialog.Exception("Couldn't create new sector", e); } }
private void OnCreateNew(object o, EventArgs args) { try { Sector sector = LevelUtil.CreateSector("NewSector"); SectorAddCommand command = new SectorAddCommand( "Added sector", sector, level); command.OnSectorAdd += OnSectorAdd; command.OnSectorRemove += OnSectorRemove; command.Do(); UndoManager.AddCommand(command); OnSectorChanged(level, sector); OnPropertiesActivated(null, null); } catch(Exception e) { ErrorDialog.Exception("Couldn't create new sector", e); } }