C# Class Nexus.Client.Games.GameDiscoverer

Searches for installed games.
Inheritance: FileSearcher
ファイルを表示 Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
Accept ( string p_strGameModeId ) : void

Accepts the current installation path that was found for the specified game mode as the correct installation path.

Cancel ( string p_strGameModeId ) : void

Cancels the search for the specified game mode.

DisableButtonOk ( string p_strGameModeId ) : void

Cancels the search for the specified game mode.

Find ( IEnumerable p_lstGameModesToFind ) : void

Searchs for the games described by the given game mode descriptors.

GameDiscoverer ( ) : System

The default constructor.

GetFinalPath ( string p_strGameModeId ) : string

Gets the confirmed installation path of the specified game mode.

This will return null until an installation path has been accepted or overridden for the specified game mode.

HasCandidates ( string p_strGameModeId ) : bool

Determines if the detector has found any installation path candidates that have not been rejected or accepted.

IsFound ( string p_strGameModeId ) : bool

Determines of the installation path for the specified game mode has been found.

This returns true if an installation path for the specified ame mode has been accepted, or if one one specified useing Override(string,string).

Override ( string p_strGameModeId, string p_strInstallPath ) : void

Overrides the installation path of the specified game mode with the given path.

Reject ( string p_strGameModeId ) : void

Rejects the current installation path of the specified game mode, and indicates the detector should continue searching.

Verify ( string p_strGameModeId, string p_strInstallPath ) : bool

Determines if the given installation path contains the specified game.

Protected Methods

Method Description
FoundCandidate ( IGameModeDescriptor gmdGameMode, string p_strInstallationPath ) : void

Adds the given path as an installation path candidate for the specified game.

OnDisableButOk ( GameModeDiscoveredEventArgs e ) : void

Raises the PathFound event.

OnDisableButOk ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void

Raises the PathFound event.

OnFileFound ( EventArgs e ) : void

Raises the FileSearcher.FileFound event.

This determines the game mode whose file has been found, and raises the PathFound event as required.

OnGameResolved ( GameModeDiscoveredEventArgs e ) : void

Raises the GameResolved event.

OnGameResolved ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void

Raises the PathFound event.

OnPathFound ( GameModeDiscoveredEventArgs e ) : void

Raises the PathFound event.

OnPathFound ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void

Raises the PathFound event.

OnTaskEnded ( TaskEndedEventArgs e ) : void

Raises the IBackgroundTask.TaskEnded event.

This raises the GameResolved event for any games that were not found.

Private Methods

Method Description
Stop ( string p_strGameModeId ) : void

Stops the search for the specified game mode.

Method Details

Accept() public method

Accepts the current installation path that was found for the specified game mode as the correct installation path.
public Accept ( string p_strGameModeId ) : void
p_strGameModeId string The id of the game mode whose current installation path is to be accepted.
return void

Cancel() public method

Cancels the search for the specified game mode.
public Cancel ( string p_strGameModeId ) : void
p_strGameModeId string The id of the game mode for which to stop searching.
return void

DisableButtonOk() public method

Cancels the search for the specified game mode.
public DisableButtonOk ( string p_strGameModeId ) : void
p_strGameModeId string The id of the game mode for which to stop searching.
return void

Find() public method

Searchs for the games described by the given game mode descriptors.
public Find ( IEnumerable p_lstGameModesToFind ) : void
p_lstGameModesToFind IEnumerable The game mode factorie of the games to search for.
return void

FoundCandidate() protected method

Adds the given path as an installation path candidate for the specified game.
protected FoundCandidate ( IGameModeDescriptor gmdGameMode, string p_strInstallationPath ) : void
gmdGameMode IGameModeDescriptor The game mode for which to set an installation path candidate.
p_strInstallationPath string The installation path candidate.
return void

GameDiscoverer() public method

The default constructor.
public GameDiscoverer ( ) : System
return System

GetFinalPath() public method

Gets the confirmed installation path of the specified game mode.
This will return null until an installation path has been accepted or overridden for the specified game mode.
public GetFinalPath ( string p_strGameModeId ) : string
p_strGameModeId string The id of the game mode for which to return the confirmed installation path.
return string

HasCandidates() public method

Determines if the detector has found any installation path candidates that have not been rejected or accepted.
public HasCandidates ( string p_strGameModeId ) : bool
p_strGameModeId string The id of the game mode for which it is to be determined if there are any installation path candidates.
return bool

IsFound() public method

Determines of the installation path for the specified game mode has been found.
This returns true if an installation path for the specified ame mode has been accepted, or if one one specified useing Override(string,string).
public IsFound ( string p_strGameModeId ) : bool
p_strGameModeId string the id of the game mode for which it is to be determined if the installation path has been found.
return bool

OnDisableButOk() protected method

Raises the PathFound event.
protected OnDisableButOk ( GameModeDiscoveredEventArgs e ) : void
e GameModeDiscoveredEventArgs An describing the task that was started.
return void

OnDisableButOk() protected method

Raises the PathFound event.
protected OnDisableButOk ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void
p_gmdGameMode IGameModeDescriptor The game mode which has been resolved.
p_strFoundPath string The installaiton path that was found.
return void

OnFileFound() protected method

Raises the FileSearcher.FileFound event.
This determines the game mode whose file has been found, and raises the PathFound event as required.
protected OnFileFound ( EventArgs e ) : void
e EventArgs The describing the event arguments.
return void

OnGameResolved() protected method

Raises the GameResolved event.
protected OnGameResolved ( GameModeDiscoveredEventArgs e ) : void
e GameModeDiscoveredEventArgs An describing the task that was started.
return void

OnGameResolved() protected method

Raises the PathFound event.
protected OnGameResolved ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void
p_gmdGameMode IGameModeDescriptor The game mode which has been resolved.
p_strFoundPath string The installaiton path that was found.
return void

OnPathFound() protected method

Raises the PathFound event.
protected OnPathFound ( GameModeDiscoveredEventArgs e ) : void
e GameModeDiscoveredEventArgs An describing the task that was started.
return void

OnPathFound() protected method

Raises the PathFound event.
protected OnPathFound ( IGameModeDescriptor p_gmdGameMode, string p_strFoundPath ) : void
p_gmdGameMode IGameModeDescriptor The game mode for which a path was found.
p_strFoundPath string The installaiton path that was found.
return void

OnTaskEnded() protected method

Raises the IBackgroundTask.TaskEnded event.
This raises the GameResolved event for any games that were not found.
protected OnTaskEnded ( TaskEndedEventArgs e ) : void
e Nexus.Client.BackgroundTasks.TaskEndedEventArgs The describing the event arguments.
return void

Override() public method

Overrides the installation path of the specified game mode with the given path.
public Override ( string p_strGameModeId, string p_strInstallPath ) : void
p_strGameModeId string The id of the game mode whose installation path is to be overridden.
p_strInstallPath string The path to use as the specified game mode's installation path.
return void

Reject() public method

Rejects the current installation path of the specified game mode, and indicates the detector should continue searching.
public Reject ( string p_strGameModeId ) : void
p_strGameModeId string The id of the game mode whose current installation path is to be rejected.
return void

Verify() public method

Determines if the given installation path contains the specified game.
public Verify ( string p_strGameModeId, string p_strInstallPath ) : bool
p_strGameModeId string The id of the game mode for which the path is to be verified.
p_strInstallPath string The path to verify as being an installation path.
return bool