protected virtual void OnRoomDetailsChange(RoomBase room) { var handler = RoomDetailsChange; if (handler != null) { handler(room); } }
public void DisconnectSlaveRoom(RoomBase room) { if (_connectedRooms.Contains(room)) { _connectedRooms.Remove(room); #if DEBUG Debug.WriteWarn(string.Format("Room ID {0} disconnected from Room ID {1}", room.Id, Id)); #endif OnDivisibleStateChanged(room, DivisibleStateChangeType.Disconnected); } }
protected virtual void OnRoomOccupiedChange(RoomBase room, bool occupied) { var handler = RoomOccupiedChange; if (handler == null) { return; } try { handler(room, occupied); } catch (Exception e) { CloudLog.Exception(e, "Error raising event"); } }
public void ConnectSlaveRoom(RoomBase room) { if (DivisibleRoomType != DivisibleRoomType.Master && room.DivisibleRoomType != DivisibleRoomType.Slave) { throw new Exception("Cannot connect these room types"); } if (_connectedRooms.Contains(room)) { return; } _connectedRooms.Add(room); #if DEBUG Debug.WriteWarn(string.Format("Room ID {0} connected to Room ID {1}", room.Id, Id)); #endif OnDivisibleStateChanged(room, DivisibleStateChangeType.Connected); }
internal UserPrompt PromptUsers(RoomBase room, PromptUsersResponse responseCallBack, uint customSubPageJoin, string title, string subTitle, uint timeOutInSeconds, object userDefinedObject, params PromptAction[] promptActions) { var prompt = new UserPrompt { Room = room, Actions = promptActions.ToList(), CallBack = responseCallBack, Title = title, SubTitle = subTitle, TimeOutInSeconds = timeOutInSeconds, UserDefinedObject = userDefinedObject, CustomSubPageJoin = customSubPageJoin }; AddPrompt(prompt); return(prompt); }
private void OnSourceChange(RoomBase room, SourceBase previousSource, SourceBase newSource) { var handler = SourceChange; var args = new RoomSourceChangeEventArgs(previousSource, newSource); CloudLog.Info("{0} has changed sources from {1} to {2}", room, previousSource != null ? previousSource.ToString() : "Off", newSource != null ? newSource.ToString() : "Off"); StartSourceChangeProcess(previousSource, newSource); try { if (handler != null) { handler(room, args); } } catch (Exception e) { CloudLog.Exception(e); } }
protected DisplayBase(RoomBase room, DisplayDeviceBase displayDevice) : this(room.System, displayDevice) { AssignToRoom(room); }
public void AssignToRoom(RoomBase room) { Room = room; }
protected abstract void OnDivisibleStateChanged(RoomBase room, DivisibleStateChangeType changeType);
/// <summary> /// Create a source which is local to a room and assigned for use only in the room /// </summary> /// <param name="room">The room which the source is assigned to</param> /// <param name="type">The type of source</param> /// <param name="device">The device driver for the source</param> protected SourceBase(RoomBase room, SourceType type, ISourceDevice device) : this(room.System, type, device) { _assignedRoom = room; }
/// <summary> /// Get a collection of displays assigned to a room or are global /// </summary> /// <param name="room">A room</param> /// <returns>DisplayCollection</returns> public DisplayCollection ForRoomOrGlobal(RoomBase room) { var displays = this.Where(d => d.Room == room || d.Room == null); return(new DisplayCollection(displays)); }
/// <summary> /// Get a collection of displays assigned to a specific room /// </summary> /// <param name="room">A Room</param> /// <returns>DisplayCollection</returns> public DisplayCollection ForRoom(RoomBase room) { var displays = this.Where(d => d.Room == room); return(new DisplayCollection(displays)); }
public SourceCollection GetSources(RoomBase room) { return(new SourceCollection(_collection.ForRoomOrGlobal(room).Where(s => s.Group == this))); }
/// <summary> /// Get a collection of sources assigned to a specific room or is a global source /// </summary> /// <param name="room">A room</param> /// <returns>SourceCollection</returns> public SourceCollection ForRoomOrGlobal(RoomBase room) { var sources = this.Where(s => (s.AssignedRoom == room || s.AssignedRoom == null) && !s.IsLocalToDisplayOnly); return(new SourceCollection(sources)); }
/// <summary> /// Get a collection of sources assigned to a specific room /// </summary> /// <param name="room">A Room</param> /// <returns>SourceCollection</returns> public SourceCollection ForRoom(RoomBase room) { var sources = this.Where(s => s.AssignedRoom == room); return(new SourceCollection(sources)); }