O'Reilly logo

Learning Microsoft Cognitive Services - Second Edition by Leif Larsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting operation results

Before we check the operation status, we want to add a new EventArgs class. Add the following at the bottom of the file:

    public class VideoOperationResultEventArgs : EventArgs { 
        public string Status { get; set; } 
        public string Message { get; set; } 
        public string ProcessingResult { get; set; } 
        public string ResourceLocation { get; set; } 
    } 

This class will contain a status, a message, and either the processing result or the resource location. We will learn more about the latter two as we progress.

Additionally, we want to add another event to the VideoOperations class, as follows:

    public event EventHandler<VideoOperationResultEventArgs> OnVideoOperationCompleted; 

Add a helper function to raise this event, as follows ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required