void healthMonitor_ReportSampledData(object sender, SimpleEventArgs <SampleData> e) { try { if (e.Result is QualityData) { QualityData data = (QualityData)e.Result; if (data.IsSnapshot) { ReportSnapshotData(data); } else { ReportQualityData(data); } } else if (e.Result is DownloadErrorAggregatedData) { ReportDownloadErrorData((DownloadErrorAggregatedData)e.Result); } } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
void healthMonitor_LatencyAlert(object sender, SimpleEventArgs <SmoothStreamingEvent> e) { //data1 = bitrate; data2 = chunkId * 2000000; data3 = bytes; value = download time try { LatencyAlertLog log; if (e.Result.EventType == EventType.VideoChunkDownload) { log = new VideoLatencyAlertLog(); } else { log = new AudioLatencyAlertLog(); } PopulateSimpleVideoLog(log); log.MediaElementId = e.Result.MediaElementId; log.BitRate = Convert.ToInt32(e.Result.Data1); log.ChunkId = e.Result.Data2; log.DurationSeconds = Convert.ToInt64(e.Result.Value); SendLog(log); } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
public static void FireLoadReport(SimpleEventArgs args) { if (LoadReport != null) { LoadReport(args); } }
void healthMonitor_LatencyAlert(object sender, SimpleEventArgs<SmoothStreamingEvent> e) { //data1 = bitrate; data2 = chunkId * 2000000; data3 = bytes; value = download time try { LatencyAlertLog log; if (e.Result.EventType == EventType.VideoChunkDownload) { log = new VideoLatencyAlertLog(); } else { log = new AudioLatencyAlertLog(); } PopulateSimpleVideoLog(log); log.MediaElementId = e.Result.MediaElementId; log.BitRate = Convert.ToInt32(e.Result.Data1); log.ChunkId = e.Result.Data2; log.DurationSeconds = Convert.ToInt64(e.Result.Value); SendLog(log); } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
void EventLoginFailed(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { MessageBox.Show("Mensaje detallado: " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.DialogResult = DialogResult.Abort; })); }
void EventErrorPopUP(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { MessageBox.Show("Se perdio la conexion con el Dns o ocurrio algun error: " + e.Message, "Error inesperado", MessageBoxButtons.OK, MessageBoxIcon.Error); })); }
void Instance_Notified(object sender, SimpleEventArgs<Notification> e) { NotifyIcon.ShowCustomBalloon(CreateBalloon(e.Data), PopupAnimation.Fade, 10000); if (!IsActive) { NotifyIcon.Icon = GUI.Images.Resources.openEngSB_info; } }
private void ClientWebSocketConnectionOnStateCommandReceived(object sender, SimpleEventArgs <StateCommand> simpleEventArgs) { Invoke(new Action(() => { StateCommand stateCommand = simpleEventArgs.Value; if (string.IsNullOrEmpty(stateCommand.ConferenceId)) { MessageBox.Show(this, "Unable create or join conference! Retry later!"); Close(); } else { ConferenceId = stateCommand.ConferenceId; _isPresenter = stateCommand.IsPresenter; _presenterWidth = stateCommand.PresenterWidth; _presenterHeight = stateCommand.PresenterHeight; _id = stateCommand.ParticipantId; _paintControl.Mode = PaintControlModes.Silent; silentRadioButton.Checked = true; if (_isPresenter) { silentRadioButton.Visible = true; drawRadioButton.Visible = true; inputRadioButton.Visible = false; } else { silentRadioButton.Visible = true; drawRadioButton.Visible = true; inputRadioButton.Visible = true; } if (_isPresenter) { StartDiffDetectThread(); _paintControl.Init(_presenterWidth, _presenterHeight, Color.Black, _topMostForm); _topMostForm.Show(); _topMostForm.SetClickThrough(true); } else { _paintControl.Init(_presenterWidth, _presenterHeight, Color.Black, null); } conferenceIdValueLabel.Text = ConferenceId; _diffFrame = new Bitmap(_presenterWidth, _presenterHeight); roleValueLabel.Text = _isPresenter ? "Presenter" : "Viewer"; StartProcessCommandsThread(); } })); }
async void Subscriber1Handler(object sender, SimpleEventArgs e) { await Task.Delay(1000); Subscriber1Text = "Subscriber 1: " + e.message; if (handler2 != null) { handler2(this, new SimpleEventArgs2("T1Msg: " + e.message)); } }
void EventUpdateContactStatusResponse(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { string contact = e.Message.Split('@')[0]; bool isConnected = e.Message.Split('@')[1].Equals("1"); updateContactList[contact] = isConnected; UpdateFormContactList(updateContactList); })); }
private void UploadCancelledEvent(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { MessageBox.Show(e.Message, "Descarga de archivo", MessageBoxButtons.OK, MessageBoxIcon.Error); this.lblStatus.Text = "Ocurrio un error"; this.progressBar.Value = 0; this.btnCerrar.Text = "Cerrar"; })); }
void healthMonitor_ReportSnapshotData(object sender, SimpleEventArgs <SampleData> e) { try { if (e.Result is QualityData) { ReportSnapshotData((QualityData)e.Result); } } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
void EventErrorPopUP(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { try { ForceDisconnect(); } catch (Exception ex) { log.Error("ForceDisconnect", ex); } MessageBox.Show("Se perdio la conexion con el Servidor de Comunicacion o ocurrio algun error: " + e.Message, "Error inesperado para volver a intentar conectar cierre la apliacación", MessageBoxButtons.OK, MessageBoxIcon.Error); })); }
void healthMonitor_ReportTraceLogs(object sender, SimpleEventArgs <IEnumerable <TraceEntry> > e) { foreach (var trace in e.Result) { TraceLog tracelog = new TraceLog(); tracelog.ClassName = trace.ClassName; tracelog.Date = trace.Date.ToUniversalTime(); tracelog.MediaElementId = trace.MediaElementId; tracelog.MethodName = trace.MethodName; tracelog.Text = trace.Text; tracelog.ThreadId = trace.ThreadId; tracelog.TraceArea = trace.TraceArea.ToString(); tracelog.TraceLevel = trace.TraceLevel.ToString(); SendLog(tracelog); } }
void healthMonitor_ReportSampledData(object sender, SimpleEventArgs<SampleData> e) { try { if (e.Result is QualityData) { QualityData data = (QualityData)e.Result; if (data.IsSnapshot) ReportSnapshotData(data); else ReportQualityData(data); } else if (e.Result is DownloadErrorAggregatedData) ReportDownloadErrorData((DownloadErrorAggregatedData)e.Result); } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
private void EventAddContactResponse(object sender, SimpleEventArgs e) { this.BeginInvoke((Action)(delegate { string opResult = e.Message.Split('|')[4]; string message; MessageBoxIcon icon; if (opResult.Equals(MessageConstants.MESSAGE_SUCCESS)) { message = "Contacto agregado con exito"; icon = MessageBoxIcon.Information; } else { message = "Ocurrio un error al agregar el contacto"; icon = MessageBoxIcon.Error; } MessageBox.Show(message, "Alta de Contacto", MessageBoxButtons.OK, icon); })); }
private void AgentView_OnCopy(object sender, SimpleEventArgs <string> e) { var view = (AgentView)sender; var viewModel = (MainViewModel)DataContext; var source = (AgentViewModel)view.DataContext; var destination = view.Orientation == "Left" ? viewModel.Right : viewModel.Left; var sourceT = new Tuple <string, FileEntry>(source.ActiveAgent.Host, (FileEntry)source.SelectedEntry); var destinationT = new Tuple <string, DirectoryEntry>(destination.ActiveAgent.Host, destination.ActiveDirectory); var copyFileViewModel = new CopyFileViewModel(sourceT, destinationT); copyFileViewModel.Start.Execute(null); var copyWindow = new CopyFileView(copyFileViewModel) { Owner = this }; copyWindow.ShowDialog(); }
//public static void BroadcastSendDiff(DiffItem diffItem) //{ // var connections = new Dictionary<Connection, ServerWebSocketConnection>().ToList(); // lock (Connections) // connections = Connections.ToList(); // foreach (var connection in connections) // { // if (connection.Key != _presenterConnection) // connection.Value.SendDiff(diffItem); // } //} private static void ServerWebSocketConnectionOnGetStateCommandReceived(object sender, SimpleEventArgs <QueryStateCommand> connectionEventArgs) { GetStateCommandReceived.Invoke(sender, connectionEventArgs); }
void healthMonitor_EventCreated(object sender, SimpleEventArgs<SmoothStreamingEvent> e) { try { switch (e.Result.EventType) { case EventType.StreamStarted: // we keep this object around for reference var streamStartedLog = new VideoStartLog(); PopulateVideoEventLog(streamStartedLog); if (streamLoadedLog != null) { streamStartedLog.EdgeIP = streamLoadedLog.EdgeIP; streamStartedLog.ClientIP = streamLoadedLog.ClientIP; streamStartedLog.VideoUrl = streamLoadedLog.VideoUrl; streamStartedLog.MaxBitRate = streamLoadedLog.MaxBitRate; } streamStartedLog.MediaElementId = e.Result.MediaElementId; streamStartedLog.IsLive = e.Result.IsLive; SendLog(streamStartedLog); break; case EventType.StreamLoaded: // we keep this object around for reference streamLoadedLog = new VideoLoadLog(); PopulateVideoEventLog(streamLoadedLog); streamLoadedLog.EdgeIP = healthMonitor.EdgeServer; streamLoadedLog.ClientIP = healthMonitor.ClientIP; streamLoadedLog.VideoUrl = e.Result.Data1; streamLoadedLog.MediaElementId = e.Result.MediaElementId; streamLoadedLog.IsLive = e.Result.IsLive; { double maxBitRate = 0; if (double.TryParse(e.Result.Data2, out maxBitRate)) streamLoadedLog.MaxBitRate = maxBitRate; } //streamStartedLog.CDNBlocked = healthMonitor.AnonymousProxy; SendLog(streamLoadedLog); break; case EventType.StreamEnded: VideoStopLog streamEndedLog = new VideoStopLog(); PopulateVideoEventLog(streamEndedLog); streamEndedLog.MediaElementId = e.Result.MediaElementId; streamEndedLog.IsLive = e.Result.IsLive; //streamEndedLog.VideoUrl = e.Result.Data1; SendLog(streamEndedLog); break; case EventType.ClipStarted: VideoClipStartedLog clipStartLog = new VideoClipStartedLog(); PopulateVideoEventLog(clipStartLog); //clipStartLog.VideoUrl = e.Result.Data1; clipStartLog.MediaElementId = e.Result.MediaElementId; clipStartLog.IsLive = e.Result.IsLive; SendLog(clipStartLog); break; case EventType.ClipEnded: VideoClipEndedLog clipEndLog = new VideoClipEndedLog(); PopulateVideoEventLog(clipEndLog); clipEndLog.MediaElementId = e.Result.MediaElementId; clipEndLog.IsLive = e.Result.IsLive; //clipEndLog.VideoUrl = e.Result.Data1; SendLog(clipEndLog); break; case EventType.MediaFailed: MediaFailedLog mediaFailed = new MediaFailedLog(); PopulateVideoEventLog(mediaFailed); mediaFailed.Reason = e.Result.Data1; mediaFailed.EdgeIP = healthMonitor.EdgeServer; mediaFailed.IsLive = e.Result.IsLive; mediaFailed.MediaElementId = e.Result.MediaElementId; //mediaFailed.VideoUrl = e.Result.Data2; //mediaFailed.VideoTimelineMarker = Convert.ToInt64(e.Result.Data3); SendLog(mediaFailed); break; case EventType.FullScreenChanged: Log fullScreenLog; if (Convert.ToBoolean(Convert.ToInt32(e.Result.Value))) fullScreenLog = CreateVideoLog(VideoLogTypes.FullScreenEntered); else fullScreenLog = CreateVideoLog(VideoLogTypes.FullScreenExit); SendLog(fullScreenLog); break; default: break; } } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
private void retryMonitor_Retrying(object sender, SimpleEventArgs<Exception> e) { // log error if (e != null && e.Result != null && e.Result.Message != null) Logger.Log(new PlayerLog(PlayerLogType.MediaFailedRetry) { Sender = this, Message = string.Format("MediaRetry:{0}", e.Result.Message) }); else Logger.Log(new PlayerLog(PlayerLogType.MediaFailedRetry) { Sender = this, Message = string.Format("MediaRetry: (no exception)") }); // pass to any consumers if (Retrying != null) { Retrying(this, null); } }
private static void ConnectionManagerOnInputCommandReceived(object sender, SimpleEventArgs <InputCommand> simpleEventArgs) { Queue.Enqueue(simpleEventArgs.Value); }
private static void ConnectionManagerPaintDelteFigureCommandRecieved(object sender, SimpleEventArgs <PaintDeleteFigureCommand> e) { Queue.Enqueue(e.Value); }
private void ClientWebSocketConnectionPaintDeleteFigureCommandRecieved(object sender, SimpleEventArgs <PaintDeleteFigureCommand> e) { _queue.Enqueue(e.Value); }
protected void RemoveLbtn_Click(object sender, EventArgs e) { SimpleEventArgs<int> eventArgs = new SimpleEventArgs<int>(eventId); RemoveClick(this, eventArgs); }
public void IncomingUpdate(object sender, SimpleEventArgs e) { Update_Tile(); }
private void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { SimpleEventArgs<Exception> requestFailedArgs = null; if (e.Error == null && !string.IsNullOrEmpty(e.Result)) { try { if (RequestCompleted != null) { RequestCompleted(this, new SimpleEventArgs<string>(e.Result)); } Logger.Log(new DebugLog() { Sender = this, Message = String.Format("Request completed. Url: {0} ", this.Source.Url) }); } catch (Exception x) { requestFailedArgs = new SimpleEventArgs<Exception>(x); } } else { requestFailedArgs = new SimpleEventArgs<Exception>(e.Error); } if (requestFailedArgs != null) { if (RequestFailed != null) { RequestFailed(this, requestFailedArgs); } Logger.Log(new DebugLog() { Sender = this, Message = String.Format("Request failed. Url: {0} ", this.Source.Url) }); } (sender as WebClient).DownloadStringCompleted -= webClient_DownloadStringCompleted; (sender as WebClient).DownloadProgressChanged -= webClient_DownloadProgressChanged; }
private void ClientWebSocketConnectionOnDiffCommandReceived(object sender, SimpleEventArgs <DiffCommand> simpleEventArgs) { _queue.Enqueue(simpleEventArgs.Value); }
void Logger_LogReceived(object sender, SimpleEventArgs<Log> e) { Debug.WriteLine(e.Result.Message); }
private static void ServerWebSocketConnectionOnDiffCommandReceived(object sender, SimpleEventArgs <DiffCommand> connectionEventArgs) { DiffCommandReceived.Invoke(sender, connectionEventArgs); }
void healthMonitor_ReportSnapshotData(object sender, SimpleEventArgs<SampleData> e) { try { if (e.Result is QualityData) ReportSnapshotData((QualityData)e.Result); } catch (Exception ex) { LoggingService.Current.BroadcastException(ex); } }
private void ClientWebSocketConnectionOnControlAccessCommandReceived(object sender, SimpleEventArgs <ControlAccessCommand> e) { _queue.Enqueue(e.Value); }
void healthMonitor_ReportTraceLogs(object sender, SimpleEventArgs<IEnumerable<TraceEntry>> e) { foreach (var trace in e.Result) { TraceLog tracelog = new TraceLog(); tracelog.ClassName = trace.ClassName; tracelog.Date = trace.Date.ToUniversalTime(); tracelog.MediaElementId = trace.MediaElementId; tracelog.MethodName = trace.MethodName; tracelog.Text = trace.Text; tracelog.ThreadId = trace.ThreadId; tracelog.TraceArea = trace.TraceArea.ToString(); tracelog.TraceLevel = trace.TraceLevel.ToString(); SendLog(tracelog); } }
private static void ServerWebSocketConnectionOnInputCommandReceived(object sender, SimpleEventArgs <InputCommand> simpleEventArgs) { InputCommandReceived.Invoke(sender, simpleEventArgs); }
private void Unsubscribing(object sender, SimpleEventArgs<string> e) { _Subject.Detach(this); }
/// <summary> /// Sets the people. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="string"/> instance containing the event data.</param> private void AddFantasyTeam(object sender, SimpleEventArgs<string> e) { if (string.IsNullOrEmpty(e.Value)) { return; } string p = e.Value.Trim(); if (!_fantasyTeams.Contains(p)) { _fantasyTeams.Add(p); } bool cont = false; if (_fantasyTeamDisplay == "my") { if (_fantasyTeamName == e.Value) { cont = true; } } else if (_fantasyTeamDisplay == "all") { cont = true; } if (!cont) { return; } //todo: should do this from the presenter bool found = _fantasyTeamView.Find(p1 => p1.FantasyTeam == p) != null; if (!found) { LaunchPersonTeamView(p); } }
private static void ConnectionManagerOnDiffCommandReceived(object sender, SimpleEventArgs <DiffCommand> connectionEventArgs) { Queue.Enqueue(connectionEventArgs.Value); }
private void UpdatePlayer(object sender, SimpleEventArgs<IPlayer> e) { new UpdatePlayers().UpdatePlayer(_Players, e.Value, e.Value.Id); }
private static void ConnectionManagerOnRequestControlCommandReceived(object sender, SimpleEventArgs <RequestControlCommand> e) { Queue.Enqueue(e.Value); }
/// <summary> /// Sets the people. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="string"/> instance containing the event data.</param> private void AddPerson(object sender, SimpleEventArgs<string> e) { if (string.IsNullOrEmpty(e.Value)) { return; } string p = e.Value.ToUpper().Trim(); if (!_People.Contains(p)) { _People.Add(p); } //todo: should do this from the presenter bool found = _PersonTeamViews.Find(p1 => p1.FantasyTeam == p) != null; if (!found) { LaunchPersonTeamView(p); } }
void Subscriber1Handler(object sender, SimpleEventArgs e) { Subscriber1Text = "Subscriber 1: " + e.message; }
private static void ServerWebSocketConnectionOnControlAccessCommandReceived(object sender, SimpleEventArgs <ControlAccessCommand> simpleEventArgs) { ControllAccessCommandReceived.Invoke(sender, simpleEventArgs); }
private void UpdatePlayer(object sender, SimpleEventArgs<IPlayer> e) { var player = _players.FirstOrDefault(p => p.Overall.Equals(e.Value.Overall)); if (player == null) { return; } player.FantasyTeam = e.Value.FantasyTeam; player.IsWatching = e.Value.IsWatching; }
private static void ServerWebSocketConnectionPaintDeleteFigureCommandRecieved(object sender, SimpleEventArgs <PaintDeleteFigureCommand> e) { PaintDeleteFigureCommandRecieved.Invoke(sender, e); }
private void Update(object sender, SimpleEventArgs <AgentEntity> args) { OnPropertyChanged("Agents"); }
private void ClientWebSocketConnectionOnConnectionStateChanged(object sender, SimpleEventArgs <bool> webSocketEventArgs) { Invoke(new Action(() => { if (webSocketEventArgs.Value) { connectionStateValueLabel.Text = "Connected"; ClientWebSocketConnection.QueryState(ConferenceId, (int)(Screen.PrimaryScreen.Bounds.Width * ScreenshotScale), (int)(Screen.PrimaryScreen.Bounds.Height * ScreenshotScale), ClientName); } else { connectionStateValueLabel.Text = "Connecting..."; _runDiffDetectThread = false; _runProcessCommandsThread = false; } })); }