C# Class White.Core.Application

Represents a process which contains windows.
Inheritance: IDisposable
Afficher le fichier Open project: PulseMiningSystems/White Class Usage Examples

Méthodes publiques

Méthode Description
Attach ( Process process ) : Application

Attaches with existing process

Attach ( int processId ) : Application

Creates an Application object for existing process

Attach ( string executable ) : Application

Attaches with existing process

AttachOrLaunch ( ProcessStartInfo processStartInfo ) : Application

Attaches to the process if it is running or launches a new process

Close ( ) : void

Tries to find the main window, then close it. If it hasn't closed in 5 seconds, kill the process

Dispose ( ) : void
Equals ( object obj ) : bool

Two applications are equal if they have the same process

Find ( Predicate match, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window

Looks at all the windows visible for the application and finds one which matches the condition. The match is run against the title of the windows

FindSplash ( ) : White.Core.UIItems.WindowItems.Window
GetHashCode ( ) : int
GetWindow ( White.Core.UIItems.Finders.SearchCriteria searchCriteria, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window

Find the first window which belongs to this application and satisfies the critera.

GetWindow ( string title ) : White.Core.UIItems.WindowItems.Window

Get visible window

GetWindow ( string title, White.Core.Factory.InitializeOption option ) : White.Core.UIItems.WindowItems.Window

Get visible window

GetWindows ( ) : List

All windows belonging to the application

Kill ( ) : void

Kills the applications and waits till it is closed

KillAndSaveState ( ) : void

Kills the application. Read Application.Kill. It also saves the application test execution state. This saves the position of the window UIItems which would be loaded next time automatically for improved performance. You would need to use InitializedOption.AndIdentifiedBy for specifying the identification of window.

Launch ( ProcessStartInfo processStartInfo ) : Application

Lauches the process and creates and Application object for it

Launch ( string executable ) : Application

Runs the process identified by the executable and creates Application object for this executable

WaitWhileBusy ( ) : void

Waits till application is busy.

Méthodes protégées

Méthode Description
Application ( ) : System

Private Methods

Méthode Description
Application ( Process process ) : System
ReplaceLast ( string replaceIn, string replace, string with ) : string

Method Details

Application() protected méthode

protected Application ( ) : System
Résultat System

Attach() public static méthode

Attaches with existing process
public static Attach ( Process process ) : Application
process System.Diagnostics.Process
Résultat Application

Attach() public static méthode

Creates an Application object for existing process
public static Attach ( int processId ) : Application
processId int
Résultat Application

Attach() public static méthode

Attaches with existing process
public static Attach ( string executable ) : Application
executable string
Résultat Application

AttachOrLaunch() public static méthode

Attaches to the process if it is running or launches a new process
public static AttachOrLaunch ( ProcessStartInfo processStartInfo ) : Application
processStartInfo System.Diagnostics.ProcessStartInfo
Résultat Application

Close() public méthode

Tries to find the main window, then close it. If it hasn't closed in 5 seconds, kill the process
public Close ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Equals() public méthode

Two applications are equal if they have the same process
public Equals ( object obj ) : bool
obj object
Résultat bool

Find() public méthode

Looks at all the windows visible for the application and finds one which matches the condition. The match is run against the title of the windows
public Find ( Predicate match, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window
match Predicate
initializeOption White.Core.Factory.InitializeOption option for the window which matches the condition
Résultat White.Core.UIItems.WindowItems.Window

FindSplash() public méthode

public FindSplash ( ) : White.Core.UIItems.WindowItems.Window
Résultat White.Core.UIItems.WindowItems.Window

GetHashCode() public méthode

public GetHashCode ( ) : int
Résultat int

GetWindow() public méthode

Find the first window which belongs to this application and satisfies the critera.
public GetWindow ( White.Core.UIItems.Finders.SearchCriteria searchCriteria, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window
searchCriteria White.Core.UIItems.Finders.SearchCriteria
initializeOption White.Core.Factory.InitializeOption found window would be initialized with this option
Résultat White.Core.UIItems.WindowItems.Window

GetWindow() public méthode

Get visible window
public GetWindow ( string title ) : White.Core.UIItems.WindowItems.Window
title string Title text of window displayed on desktop
Résultat White.Core.UIItems.WindowItems.Window

GetWindow() public méthode

Get visible window
public GetWindow ( string title, White.Core.Factory.InitializeOption option ) : White.Core.UIItems.WindowItems.Window
title string Title text of window displayed on desktop
option White.Core.Factory.InitializeOption Option which would be used to initialize the window.
Résultat White.Core.UIItems.WindowItems.Window

GetWindows() public méthode

All windows belonging to the application
public GetWindows ( ) : List
Résultat List

Kill() public méthode

Kills the applications and waits till it is closed
public Kill ( ) : void
Résultat void

KillAndSaveState() public méthode

Kills the application. Read Application.Kill. It also saves the application test execution state. This saves the position of the window UIItems which would be loaded next time automatically for improved performance. You would need to use InitializedOption.AndIdentifiedBy for specifying the identification of window.
public KillAndSaveState ( ) : void
Résultat void

Launch() public static méthode

Lauches the process and creates and Application object for it
public static Launch ( ProcessStartInfo processStartInfo ) : Application
processStartInfo System.Diagnostics.ProcessStartInfo
Résultat Application

Launch() public static méthode

Runs the process identified by the executable and creates Application object for this executable
public static Launch ( string executable ) : Application
executable string location of the executable
Résultat Application

WaitWhileBusy() public méthode

Waits till application is busy.
public WaitWhileBusy ( ) : void
Résultat void