C# Class ImageGlass.Services.InstanceManagement.SingleInstance

Enforces single instance for an application.
Inheritance: IDisposable
Show file Open project: d2phap/ImageGlass Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
ListenForArgumentsFromSuccessiveInstances ( ) : void

Listens for arguments being passed from successive instances of the applicaiton.

PassArgumentsToFirstInstance ( String arguments ) : System.Boolean

Passes the given arguments to the first running instance of the application.

SingleInstance ( System.Guid identifier ) : System

Enforces single instance for an application.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CallOnArgumentsReceived ( Object state ) : void

Calls the OnArgumentsReceived method casting the state Object to String[].

ListenForArguments ( Object state ) : void

Listens for arguments on a named pipe.

OnArgumentsReceived ( String arguments ) : void

Fires the ArgumentsReceived event.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

ListenForArgumentsFromSuccessiveInstances() public method

Listens for arguments being passed from successive instances of the applicaiton.
public ListenForArgumentsFromSuccessiveInstances ( ) : void
return void

PassArgumentsToFirstInstance() public method

Passes the given arguments to the first running instance of the application.
public PassArgumentsToFirstInstance ( String arguments ) : System.Boolean
arguments String The arguments to pass.
return System.Boolean

SingleInstance() public method

Enforces single instance for an application.
public SingleInstance ( System.Guid identifier ) : System
identifier System.Guid An identifier unique to this application.
return System