C# Класс OnlineVideos.Sites.BrowserUtilConnector

Base class for any browser util Implementations of this class will be passed to the OnlineVideos.Sites.WebAutomation.BrowserHost
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_loadingPicture System.Windows.Forms.PictureBox

Открытые методы

Метод Описание
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)

Приватные методы

Метод Описание
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

Описание методов

BrowserDocumentComplete() публичный абстрактный Метод

Method called when the DocumentComplete event is handled from the browser
public abstract BrowserDocumentComplete ( ) : EventResult
Результат OnlineVideos.Sites.Entities.EventResult

HideLoading() публичный Метод

Hide the loading image
public HideLoading ( ) : void
Результат void

Initialise() публичный Метод

Constructor - attach to the web browser supplied
public Initialise ( System.Windows.Forms.WebBrowser browser, ILog messageHandler ) : void
browser System.Windows.Forms.WebBrowser
messageHandler ILog
Результат void

InvokeScript() публичный Метод

Invoke javascript on the page
public InvokeScript ( string scriptToRun ) : void
scriptToRun string
Результат void

OnAction() публичный Метод

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
Результат void

OnClosing() публичный Метод

Fired when the browser host is closing
public OnClosing ( ) : void
Результат void

Pause() публичный абстрактный Метод

Pause button was pressed
public abstract Pause ( ) : EventResult
Результат OnlineVideos.Sites.Entities.EventResult

PerformLogin() публичный абстрактный Метод

Perform a login to the target website
public abstract PerformLogin ( string username, string password ) : EventResult
username string
password string
Результат OnlineVideos.Sites.Entities.EventResult

Play() публичный абстрактный Метод

Play button was pressed, so resume playback
public abstract Play ( ) : EventResult
Результат OnlineVideos.Sites.Entities.EventResult

PlayVideo() публичный абстрактный Метод

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
Результат OnlineVideos.Sites.Entities.EventResult

RemoveFileFromTempInternetFiles() публичный Метод

Remove the specified files from temporary internet files
public RemoveFileFromTempInternetFiles ( string fileNameStartsWith, string fileExtension ) : void
fileNameStartsWith string
fileExtension string
Результат void

ShowLoading() публичный Метод

Show a loading image
public ShowLoading ( ) : void
Результат void

WaitForComplete() публичный Метод

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
Результат bool

Описание свойств

_loadingPicture защищенное свойство

protected PictureBox,System.Windows.Forms _loadingPicture
Результат System.Windows.Forms.PictureBox