C# Class OnlineVideos.Sites.BrowserUtilConnector

Base class for any browser util Implementations of this class will be passed to the OnlineVideos.Sites.WebAutomation.BrowserHost
Afficher le fichier Open project: offbyoneBB/mp-onlinevideos2 Class Usage Examples

Protected Properties

Свойство Type Description
_loadingPicture System.Windows.Forms.PictureBox

Méthodes publiques

Méthode Description
BrowserDocumentComplete ( ) : EventResult

Method called when the DocumentComplete event is handled from the browser

HideLoading ( ) : void

Hide the loading image

Initialise ( System.Windows.Forms.WebBrowser browser, ILog messageHandler ) : void

Constructor - attach to the web browser supplied

InvokeScript ( string scriptToRun ) : void

Invoke javascript on the page

OnAction ( string actionEnumName ) : void

Allow implementations to handle actions which aren't handled by the browserhost Unfortunately, because of dependencies, we need to pass in the name of the action enumeration rather than the enum itself

OnClosing ( ) : void

Fired when the browser host is closing

Pause ( ) : EventResult

Pause button was pressed

PerformLogin ( string username, string password ) : EventResult

Perform a login to the target website

Play ( ) : EventResult

Play button was pressed, so resume playback

PlayVideo ( string videoToPlay ) : EventResult

Begin playback of the specified video The videoToPlay will be one of the parameters sent to the browserhost

RemoveFileFromTempInternetFiles ( string fileNameStartsWith, string fileExtension ) : void

Remove the specified files from temporary internet files

ShowLoading ( ) : void

Show a loading image

WaitForComplete ( Func forceQuit, int pollTimeout = 20 ) : bool

Poll ProcessComplete, waiting for the timeout (in seconds) Returns true if the process completed, otherwise we get false (a timeout)

Private Methods

Méthode Description
Browser_DocumentCompleted ( object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e ) : void

Pass the document completed event to the child connectors

RedirectOnError ( Exception ex ) : void

Log an error, detach the event handler and redirect to blank page

Method Details

BrowserDocumentComplete() public abstract méthode

Method called when the DocumentComplete event is handled from the browser
public abstract BrowserDocumentComplete ( ) : EventResult
Résultat OnlineVideos.Sites.Entities.EventResult

HideLoading() public méthode

Hide the loading image
public HideLoading ( ) : void
Résultat void

Initialise() public méthode

Constructor - attach to the web browser supplied
public Initialise ( System.Windows.Forms.WebBrowser browser, ILog messageHandler ) : void
browser System.Windows.Forms.WebBrowser
messageHandler ILog
Résultat void

InvokeScript() public méthode

Invoke javascript on the page
public InvokeScript ( string scriptToRun ) : void
scriptToRun string
Résultat void

OnAction() public méthode

Allow implementations to handle actions which aren't handled by the browserhost Unfortunately, because of dependencies, we need to pass in the name of the action enumeration rather than the enum itself
public OnAction ( string actionEnumName ) : void
actionEnumName string
Résultat void

OnClosing() public méthode

Fired when the browser host is closing
public OnClosing ( ) : void
Résultat void

Pause() public abstract méthode

Pause button was pressed
public abstract Pause ( ) : EventResult
Résultat OnlineVideos.Sites.Entities.EventResult

PerformLogin() public abstract méthode

Perform a login to the target website
public abstract PerformLogin ( string username, string password ) : EventResult
username string
password string
Résultat OnlineVideos.Sites.Entities.EventResult

Play() public abstract méthode

Play button was pressed, so resume playback
public abstract Play ( ) : EventResult
Résultat OnlineVideos.Sites.Entities.EventResult

PlayVideo() public abstract méthode

Begin playback of the specified video The videoToPlay will be one of the parameters sent to the browserhost
public abstract PlayVideo ( string videoToPlay ) : EventResult
videoToPlay string
Résultat OnlineVideos.Sites.Entities.EventResult

RemoveFileFromTempInternetFiles() public méthode

Remove the specified files from temporary internet files
public RemoveFileFromTempInternetFiles ( string fileNameStartsWith, string fileExtension ) : void
fileNameStartsWith string
fileExtension string
Résultat void

ShowLoading() public méthode

Show a loading image
public ShowLoading ( ) : void
Résultat void

WaitForComplete() public méthode

Poll ProcessComplete, waiting for the timeout (in seconds) Returns true if the process completed, otherwise we get false (a timeout)
public WaitForComplete ( Func forceQuit, int pollTimeout = 20 ) : bool
forceQuit Func
pollTimeout int
Résultat bool

Property Details

_loadingPicture protected_oe property

protected PictureBox,System.Windows.Forms _loadingPicture
Résultat System.Windows.Forms.PictureBox