C# Class Open.Core.Common.Network.LoaderBase

Base class for objects that implement server loading functions.
Inheritance: System.NotifyPropertyChangedBase
Exibir arquivo Open project: philcockfield/Open.TestHarness.SL

Private Properties

Property Type Description
CheckForError System.Exception

Public Methods

Method Description
Handle_OpenReadCompleted ( object sender, TestableOpenReadCompletedEventArgs e ) : void
Load ( ) : void

Commences the load operation.

Implementers see the 'OnPreload' and 'OnLoadCallback' method.

Load ( System.Action callback ) : void

Commences the load operation, and invokes a callback on complete.

Protected Methods

Method Description
GetUri ( ) : Uri

Retrieves the URI of the server location to access.

LoaderBase ( ) : System

Constructor.

LoaderBase ( TestableWebClient webClient ) : System

Constructor.

Inject a different client to teh constructor for testing purposes.

OnLoadCallback ( TestableOpenReadCompletedEventArgs e ) : void

Called after the load operation has completed.

Check the 'LoadError' property to see whether the operation was successful.

OnLoadFailed ( ) : void
OnLoaded ( ) : void
OnPreload ( ) : bool

Fired before the server call is initiated.

Private Methods

Method Description
CheckForError ( TestableOpenReadCompletedEventArgs e ) : Exception

Method Details

GetUri() protected abstract method

Retrieves the URI of the server location to access.
protected abstract GetUri ( ) : Uri
return System.Uri

Handle_OpenReadCompleted() public method

public Handle_OpenReadCompleted ( object sender, TestableOpenReadCompletedEventArgs e ) : void
sender object
e TestableOpenReadCompletedEventArgs
return void

Load() public method

Commences the load operation.
Implementers see the 'OnPreload' and 'OnLoadCallback' method.
public Load ( ) : void
return void

Load() public method

Commences the load operation, and invokes a callback on complete.
public Load ( System.Action callback ) : void
callback System.Action The callback to invoke.
return void

LoaderBase() protected method

Constructor.
protected LoaderBase ( ) : System
return System

LoaderBase() protected method

Constructor.
Inject a different client to teh constructor for testing purposes.
protected LoaderBase ( TestableWebClient webClient ) : System
webClient TestableWebClient The web client to use.
return System

OnLoadCallback() protected abstract method

Called after the load operation has completed.
Check the 'LoadError' property to see whether the operation was successful.
protected abstract OnLoadCallback ( TestableOpenReadCompletedEventArgs e ) : void
e TestableOpenReadCompletedEventArgs The event arguments containing information about the server call.
return void

OnLoadFailed() protected method

protected OnLoadFailed ( ) : void
return void

OnLoaded() protected method

protected OnLoaded ( ) : void
return void

OnPreload() protected method

Fired before the server call is initiated.
protected OnPreload ( ) : bool
return bool