protected virtual void OnRoomSourceChange(RoomBase room, RoomSourceChangeEventArgs args) { if (room != Room || !System.Booted) { return; } try { if (SourceChange != null) { SourceChange(room, args); } } catch (Exception e) { CloudLog.Exception(e); } if (args.NewSource != null) { UIShouldShowSource(args.NewSource); } else { UIShouldShowHomePage(ShowHomePageEventType.OnClearingSource); } }
void Room_SourceChange(Room room, RoomSourceChangeEventArgs args) { try { if (Room == room) { OnSourceChange(args.PreviousSource, args.NewSource); } } catch (Exception e) { ErrorLog.Exception(string.Format("Error in {0}.Room_SourceChange(UXLib.Models.Room room, RoomSourceChangeEventArgs args)", GetType().Name), e); } }
protected override void OnRoomSourceChange(RoomBase room, RoomSourceChangeEventArgs args) { base.OnRoomSourceChange(room, args); if (args.NewSource == null) { _sourceButtons.ClearInterlockedFeedback(); return; } if (Room.OtherRooms.Count > 0 && Room.OtherRooms.First().Source == args.NewSource) { _sourceButtons.SetInterlockedFeedback(3); return; } uint sourceIndex = 0; foreach (var s in Room.Sources.TakeWhile(s => s != args.NewSource)) { sourceIndex++; } _sourceButtons.SetInterlockedFeedback(sourceIndex + 1); }