/// <summary> /// Callback of asynchronous calling GetSample method from WCF. /// </summary> /// <param name="sender">A System.Object that specifies /// the sender.</param> /// <param name="e">A WebMech.WebMechService.GetSampleCompletedEventArgs that specifies /// the result from WCF.</param> private void GetSampleWcfCompleted(object sender, GetSampleCompletedEventArgs e) { if (e.Error != null) { OperationFailing("Exception" + Environment.NewLine + e.Error.Message); return; } // show progres OperationStarting("Vykreslování ..."); // show mesh in viewport visualize.ShowSample(e.Result); // close progress OperationFinishing(); }
/// <summary> /// Do the actual ReportGetSampleCompleted work. Fires an event in case derived classes /// want to listen in. /// </summary> /// <param name="chunk">the chunk with our sample</param> /// <param name="mediaStreamSample">the sample we are reporting</param> private void DoReportGetSampleCompleted(MediaChunk chunk, MediaStreamSample mediaStreamSample) { ReportGetSampleCompleted(mediaStreamSample); GetSampleCompletedEventArgs args = new GetSampleCompletedEventArgs(); args.Sample = mediaStreamSample; args.ChunkId = (chunk != null) ? chunk.ChunkId : -1; args.Bitrate = (chunk != null) ? chunk.Bitrate : 0; args.StreamId = (chunk != null) ? chunk.StreamId : -1; if (GetSampleCompleted != null && chunk != null) { GetSampleCompleted(this, args); } }