C# Class PlexServiceWCF.PmsMonitor

Class for monitoring the status of Plex Media Server
Mostra file Open project: cjmurph/PmsService Class Usage Examples

Public Methods

Method Description
IsAuxAppRunning ( string name ) : bool
StartAuxApp ( string name ) : void
StopAuxApp ( string name ) : void

Protected Methods

Method Description
OnPlexStatusChange ( object sender, PlexServiceCommon.StatusChangeEventArgs data ) : void

Method to fire the status change event

OnPlexStop ( object sender, EventArgs data ) : void

Method to stop the monitor

Private Methods

Method Description
PmsMonitor ( ) : System
Restart ( int delay ) : void

Restart plex, wait for the specified delay between stop and start

Start ( ) : void

Start monitoring plex

Stop ( ) : void

Stop the monitor and kill the processes

disableFirstRun ( ) : void

This method will set the "FirstRun" registry key to 0 to prevent PMS from spawning the default browser.

endPlex ( ) : void

Kill the plex process

getPlexExecutable ( ) : string

Returns the full path and filename of the plex media server executable

killSupportingProcess ( string name ) : void

Kill all instances of the specified process.

killSupportingProcesses ( ) : void

Kill all processes with the specified names

plex_Exited ( object sender, EventArgs e ) : void

This event fires when the plex process we have a reference to exits

purgeAutoStartRegistryEntry ( ) : void

This method will look for and remove the "run at startup" registry key for plex media server.

startPlex ( ) : void

Start a new/get a handle on existing Plex process

Method Details

IsAuxAppRunning() public method

public IsAuxAppRunning ( string name ) : bool
name string
return bool

OnPlexStatusChange() protected method

Method to fire the status change event
protected OnPlexStatusChange ( object sender, PlexServiceCommon.StatusChangeEventArgs data ) : void
sender object
data PlexServiceCommon.StatusChangeEventArgs
return void

OnPlexStop() protected method

Method to stop the monitor
protected OnPlexStop ( object sender, EventArgs data ) : void
sender object
data System.EventArgs
return void

StartAuxApp() public method

public StartAuxApp ( string name ) : void
name string
return void

StopAuxApp() public method

public StopAuxApp ( string name ) : void
name string
return void