public void SetRoom(Room r) { var handler = new Room.RoomModifiedHandler(OnRoomModified); if (room != null) room.RoomModifiedEvent -= handler; r.RoomModifiedEvent += handler; room = r; Width = room.Width; Height = room.Height; QueueDraw(); }
void SetRoom(Room room, int season) { roomeditor1.SetRoom(room, season); // roomeditor1's changed event handler will fire, which in turn invokes "OnRoomChanged", so // don't call that here. }