C# Class GSF.ServiceProcess.ClientHelper

Inheritance: System.ComponentModel.Component, ISupportLifecycle, ISupportInitialize, IPersistSettings
Mostrar archivo Open project: GridProtectionAlliance/gsf Class Usage Examples

Private Properties

Property Type Description
BeginInit void
EndInit void
RemotingClient_ConnectionAttempt void
RemotingClient_ConnectionEstablished void
RemotingClient_ConnectionException void
RemotingClient_ConnectionTerminated void
RemotingClient_ReceiveDataComplete void
UpdateStatus void

Public Methods

Method Description
ClientHelper ( ) : GSF.Communication

Initializes a new instance of the ClientHelper class.

ClientHelper ( IContainer container ) : GSF.Communication

Initializes a new instance of the ClientHelper class.

Connect ( ) : void

Connects RemotingClient to ServiceHelper.RemotingServer and wait until authentication is complete.

Disconnect ( ) : void

Disconnects RemotingClient from ServiceHelper.RemotingServer.

Initialize ( ) : void

Initializes the ClientHelper.

Initialize() is to be called by user-code directly only if the ClientHelper is not consumed through the designer surface of the IDE.

LoadSettings ( ) : void

Loads saved settings for the ClientHelper from the config file if the PersistSettings property is set to true.

PretendRequest ( string requestCommand ) : GSF.ServiceProcess.ClientRequestInfo

Returns an ClientRequestInfo object for the specified requestCommand that can be used to invoke ServiceHelper.ClientRequestHandlers manually as if the request was sent by a ClientHelper remotely.

SaveSettings ( ) : void

Saves settings for the ClientHelper to the config file if the PersistSettings property is set to true.

SendRequest ( ClientRequest request ) : void

Sends a request to the ServiceHelper using RemotingClient.

SendRequest ( string request ) : void

Sends a request to the ServiceHelper using RemotingClient.

TryParseActionableResponse ( ServiceResponse serviceResponse, string &sourceCommand, bool &responseSuccess ) : bool

Attempts to parse an actionable response sent from the service.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the ClientHelper object and optionally releases the managed resources.

OnAuthenticationFailure ( ) : void

Raises the AuthenticationFailure event.

OnAuthenticationSuccess ( ) : void

Raises the AuthenticationSuccess event.

OnProcessStateChanged ( ObjectState state ) : void

Raises the ProcessStateChanged event.

OnReceivedServiceResponse ( ServiceResponse response ) : void

Raises the ReceivedServiceResponse event.

OnReceivedServiceUpdate ( UpdateType type, string update ) : void

Raises the ReceivedServiceUpdate event.

OnServiceStateChanged ( ObjectState state ) : void

Raises the ServiceStateChanged event.

OnTelnetSessionEstablished ( ) : void

Raises the TelnetSessionEstablished event.

OnTelnetSessionTerminated ( ) : void

Raises the TelnetSessionTerminated event.

Private Methods

Method Description
BeginInit ( ) : void
EndInit ( ) : void
RemotingClient_ConnectionAttempt ( object sender, EventArgs e ) : void
RemotingClient_ConnectionEstablished ( object sender, EventArgs e ) : void
RemotingClient_ConnectionException ( object sender, EventArgs e ) : void
RemotingClient_ConnectionTerminated ( object sender, EventArgs e ) : void
RemotingClient_ReceiveDataComplete ( object sender, int>.EventArgs e ) : void
UpdateStatus ( UpdateType type, string message ) : void

Method Details

ClientHelper() public method

Initializes a new instance of the ClientHelper class.
public ClientHelper ( ) : GSF.Communication
return GSF.Communication

ClientHelper() public method

Initializes a new instance of the ClientHelper class.
public ClientHelper ( IContainer container ) : GSF.Communication
container IContainer object that contains the .
return GSF.Communication

Connect() public method

Connects RemotingClient to ServiceHelper.RemotingServer and wait until authentication is complete.
public Connect ( ) : void
return void

Disconnect() public method

Disconnects RemotingClient from ServiceHelper.RemotingServer.
public Disconnect ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by the ClientHelper object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

Initialize() public method

Initializes the ClientHelper.
Initialize() is to be called by user-code directly only if the ClientHelper is not consumed through the designer surface of the IDE.
public Initialize ( ) : void
return void

LoadSettings() public method

Loads saved settings for the ClientHelper from the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public LoadSettings ( ) : void
return void

OnAuthenticationFailure() protected method

Raises the AuthenticationFailure event.
protected OnAuthenticationFailure ( ) : void
return void

OnAuthenticationSuccess() protected method

Raises the AuthenticationSuccess event.
protected OnAuthenticationSuccess ( ) : void
return void

OnProcessStateChanged() protected method

Raises the ProcessStateChanged event.
protected OnProcessStateChanged ( ObjectState state ) : void
state ObjectState New .
return void

OnReceivedServiceResponse() protected method

Raises the ReceivedServiceResponse event.
protected OnReceivedServiceResponse ( ServiceResponse response ) : void
response ServiceResponse received.
return void

OnReceivedServiceUpdate() protected method

Raises the ReceivedServiceUpdate event.
protected OnReceivedServiceUpdate ( UpdateType type, string update ) : void
type UpdateType One of the values.
update string Update message received.
return void

OnServiceStateChanged() protected method

Raises the ServiceStateChanged event.
protected OnServiceStateChanged ( ObjectState state ) : void
state ObjectState New .
return void

OnTelnetSessionEstablished() protected method

Raises the TelnetSessionEstablished event.
protected OnTelnetSessionEstablished ( ) : void
return void

OnTelnetSessionTerminated() protected method

Raises the TelnetSessionTerminated event.
protected OnTelnetSessionTerminated ( ) : void
return void

PretendRequest() public static method

Returns an ClientRequestInfo object for the specified requestCommand that can be used to invoke ServiceHelper.ClientRequestHandlers manually as if the request was sent by a ClientHelper remotely.
public static PretendRequest ( string requestCommand ) : GSF.ServiceProcess.ClientRequestInfo
requestCommand string Command for which an object is to be created.
return GSF.ServiceProcess.ClientRequestInfo

SaveSettings() public method

Saves settings for the ClientHelper to the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public SaveSettings ( ) : void
return void

SendRequest() public method

Sends a request to the ServiceHelper using RemotingClient.
public SendRequest ( ClientRequest request ) : void
request ClientRequest object to be sent.
return void

SendRequest() public method

Sends a request to the ServiceHelper using RemotingClient.
public SendRequest ( string request ) : void
request string Request text to be sent.
return void

TryParseActionableResponse() public static method

Attempts to parse an actionable response sent from the service.
public static TryParseActionableResponse ( ServiceResponse serviceResponse, string &sourceCommand, bool &responseSuccess ) : bool
serviceResponse ServiceResponse to test for actionable response.
sourceCommand string Command that invoked .
responseSuccess bool Boolean success state of .
return bool