LEADTOOLS Image File Support (Leadtools.Codecs assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
CodecsGetInformationAsyncCompletedEventArgs Class
See Also  Members  
Leadtools.Codecs Namespace : CodecsGetInformationAsyncCompletedEventArgs Class



Contains data for the RasterCodecs.GetInformationAsyncCompleted event.

Object Model

CodecsGetInformationAsyncCompletedEventArgs ClassCodecsImageInfo Class

Syntax

Visual Basic (Declaration) 
Public Class CodecsGetInformationAsyncCompletedEventArgs 
   Inherits CodecsAsyncCompletedEventArgs
Visual Basic (Usage)Copy Code
Dim instance As CodecsGetInformationAsyncCompletedEventArgs
C# 
public class CodecsGetInformationAsyncCompletedEventArgs : CodecsAsyncCompletedEventArgs 
C++/CLI 
public ref class CodecsGetInformationAsyncCompletedEventArgs : public CodecsAsyncCompletedEventArgs 

Example

Remarks

The RasterCodecs class supports getting information on image files asynchronously using the RasterCodecs.GetInformationAsync methods. When calling any of these methods, the caller thread will not be blocked and the method will return instantly with an instance CodecsImageInfo that is in a loading status (CodecsImageInfo.IsLoading set to true). You should not use the other properties of this object while the object is in loading status.

When the RasterCodecs object finishes getting the information on the file, the various properties of the CodecsImageInfo will be populated with the image file information and the CodecsImageInfo.IsLoading property will be set to false.

It is recommended that you do not poll for the CodecsImageInfo.IsLoading property to check when the image information has been collected, instead, subscribe to the RasterCodecs.GetInformationAsyncCompleted event to get notification on when the RasterCodecs.GetInformationAsync operation is completed and if any errors occurred.

The RasterCodecs.GetInformationAsyncCompleted event data will also contain the same object returned from RasterCodecs.GetInformationAsync so you do not have to keep the original object in your application.

The RasterCodecs.GetInformationAsyncCompleted event use data argument object of type CodecsGetInformationAsyncCompletedEventArgs. This class contains the following properties:

Property Description
Uri, Stream and FileName

Contains the URI, stream or file name passed to the method that initialized this asynchronous operation.

Only one of these properties can be a valid value (not a null reference) at any time The property that contains a valid reference depends on what version of RasterCodecs.GetInformationAsync method has been called.

For example, if RasterCodecs.GetInformationAsync(Uri uri, bool totalPages, int pageNumberobject, object userState) is being called, the CodecsAsyncCompletedEventArgs.Uri will contain the same URI passed to the method while CodecsAsyncCompletedEventArgs.Stream and CodecsAsyncCompletedEventArgs.FileName will both be null. If RasterCodecs.GetInformationAsync(string fileName, bool totalPages, int pageNumberobject, object userState) is being called, the CodecsAsyncCompletedEventArgs.FileName will contain the same file name string value passed to the method while CodecsAsyncCompletedEventArgs.Uri and CodecsAsyncCompletedEventArgs.Stream will both be null and so on.

Info

Contains the CodecsImageInfo class instance that contains the information about the image file. This instance is the same object returned from the RasterCodecs.GetInformationAsync method. While the asynchronous operation is running, the value of the CodecsImageInfo.IsLoading will be true indicating that the object is being populated with the information and should not be used. Whe the asynchronous operation compelets, the RasterCodecs.GetInformationAsyncCompleted event will fire and Info will contain the final and ready to use object. If an error occurs, this property will be set to null and the object is disposed internally by the toolkit.

Error

Contains any errors that might have occured during the asynchronous operation. You musg check this value when the RasterCodecs.GetInformationAsyncCompleted event fires and make sure it does not contain a valid System.Exception object.

Cancelled

Contains a value indicating whether an asynchronous operation has been canceled. For example, by calling RasterCodecs.CancelAsync when using RasterCodecs.GetInformationAsync with a URL

Inheritance Hierarchy

System.Object
   System.EventArgs
      System.ComponentModel.AsyncCompletedEventArgs
         Leadtools.Codecs.CodecsAsyncCompletedEventArgs
            Leadtools.Codecs.CodecsGetInformationAsyncCompletedEventArgs

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also