/// <summary> /// Publish a hearing event to all participants in conference to those connected to the HubContext /// </summary> /// <param name="hearingEventStatus">Hearing status event to publish</param> /// <returns></returns> protected async Task PublishConferenceStatusMessage(ConferenceStatus hearingEventStatus) { foreach (var participant in SourceConference.Participants) { await HubContext.Clients.Group(participant.Username.ToLowerInvariant()) .ConferenceStatusMessage(SourceConference.Id, hearingEventStatus); Logger.LogTrace($"Conference Status: Conference Id: { SourceConference.Id } | Participant Id: { participant.Id } | " + $"Role: { participant.Role } | Participant State: { hearingEventStatus } | Timestamp: { (DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss.fffffff") } "); } await HubContext.Clients.Group(Hub.EventHub.VhOfficersGroupName) .ConferenceStatusMessage(SourceConference.Id, hearingEventStatus); }
/// <summary> /// Publish a hearing event to all participants in conference to those connected to the HubContext /// </summary> /// <param name="hearingEventStatus">Hearing status event to publish</param> /// <returns></returns> protected async Task PublishConferenceStatusMessage(ConferenceStatus hearingEventStatus) { foreach (var participant in SourceConference.Participants) { await HubContext.Clients.Group(participant.Username.ToLowerInvariant()) .ConferenceStatusMessage(SourceConference.Id, hearingEventStatus); Logger.LogTrace( "Conference Status: Conference Id: {SourceConferenceId} | Participant Id: {ParticipantId} | Role: {ParticipantRole} | Participant State: {HearingEventStatus}", SourceConference.Id, participant.Id, participant.Role, hearingEventStatus); } await HubContext.Clients.Group(Hub.EventHub.VhOfficersGroupName) .ConferenceStatusMessage(SourceConference.Id, hearingEventStatus); }
/// <summary> /// Return list of all conference resources associated with a given account /// </summary> /// <param name="friendlyName">List conferences with the given FriendlyName.</param> /// <param name="status">List conferences with the given status.</param> /// <param name="dateCreated">List conferences created on, after, or before a given date.</param> /// <param name="dateCreatedComparasion">Date range can be specified using inequalities.</param> /// <param name="dateUpdated">List conferences updated on, after, or before a given date.</param> /// <param name="dateUpdatedComparasion">Date range can be specified using inequalities.</param> /// <param name="page">Used to return a particular page withing the list.</param> /// <param name="pageSize">Used to specify the amount of list items to return per page.</param> /// <returns></returns> public ConferenceResult GetConferences(string friendlyName, ConferenceStatus? status, DateTime? dateCreated, ComparisonType? dateCreatedComparasion, DateTime? dateUpdated, ComparisonType? dateUpdatedComparasion, int? page, int?pageSize) { var request = new RestRequest(); request.Resource = RequestUri.ConferencesUri; var dateCreatedParameterName = GetParameterNameWithEquality(dateCreatedComparasion, "DateCreated"); var dateUpdatedParemeterName = GetParameterNameWithEquality(dateUpdatedComparasion, "DateUpdated"); if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName); if (status.HasValue) request.AddParameter("Status", status.ToString().ToLower()); if (dateCreated.HasValue) request.AddParameter(dateCreatedParameterName, dateCreated.Value.ToString("yyyy-MM-dd")); if (dateUpdated.HasValue) request.AddParameter(dateUpdatedParemeterName, dateUpdated.Value.ToString("yyyy-MM-dd")); if (page.HasValue) request.AddParameter("Page", page); if (pageSize.HasValue) request.AddParameter("PageSize", pageSize); return Execute<ConferenceResult>(request); }
/// <summary> /// Return list of all conference resources associated with a given account /// </summary> /// <param name="status">List conferences with the given status.</param> /// <param name="dateCreated">List conferences created on, after, or before a given date. </param> /// <param name="dateCreatedComaparasion">Date range can be specified using inequalities</param> /// <returns></returns> public ConferenceResult GetConferences(ConferenceStatus status, DateTime dateCreated, ComparisonType dateCreatedComaparasion) { return GetConferences(null, status, dateCreated, dateCreatedComaparasion, null, null, null, null); }