C# Class Mercurial.AutoSwitchingClientFactory

This class implements IClientFactory by constructing either a NonPersistentClient or PersistentClient depending on circumstances, and also implements IClientSwitcher to allow for switching before or after certain commands.
Inheritance: IClientFactory, IClientSwitcher
Mostrar archivo Open project: TargetProcess/Target-Process-Plugins

Public Methods

Method Description
CreateClient ( string repositoryPath ) : IClient

Creates a new IClient object for use by the Repository.

SwitchAfterCommand ( IMercurialCommand command, IClient currentClient ) : IClient

Determines if the client should be switched out after the specific command has executed. If it is switched out, the old client should be disposed of, and a new client should be returned. If it is not switched out, the current client should be simply returned. This method is only called upon successful execution of the command.

SwitchBeforeCommand ( IMercurialCommand command, IClient currentClient ) : IClient

Determines if the client should be switched out before the specific command is executed. If it is switched out, the old client should be disposed of, and a new client should be returned. If it is not switched out, the current client should be simply returned.

Method Details

CreateClient() public method

Creates a new IClient object for use by the Repository.
/// is null or empty. ///
public CreateClient ( string repositoryPath ) : IClient
repositoryPath string /// The path to the repository to manage by the and the /// . ///
return IClient

SwitchAfterCommand() public method

Determines if the client should be switched out after the specific command has executed. If it is switched out, the old client should be disposed of, and a new client should be returned. If it is not switched out, the current client should be simply returned. This method is only called upon successful execution of the command.
/// is null. /// - or - /// is null. ///
public SwitchAfterCommand ( IMercurialCommand command, IClient currentClient ) : IClient
command IMercurialCommand /// The command that was successfully executed. ///
currentClient IClient /// The current implementation. ///
return IClient

SwitchBeforeCommand() public method

Determines if the client should be switched out before the specific command is executed. If it is switched out, the old client should be disposed of, and a new client should be returned. If it is not switched out, the current client should be simply returned.
/// is null. /// - or - /// is null. ///
public SwitchBeforeCommand ( IMercurialCommand command, IClient currentClient ) : IClient
command IMercurialCommand /// The command that is about to be executed. ///
currentClient IClient /// The current implementation. ///
return IClient