TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Api.Services.ApiService Class Reference
Inheritance diagram for TwitchLib.Api.Services.ApiService:
TwitchLib.Api.Services.FollowerService TwitchLib.Api.Services.LiveStreamMonitorService

Public Member Functions

virtual void Start ()
 Starts the service. More...
 
virtual void Stop ()
 Stops the service. More...
 

Protected Member Functions

 ApiService (ITwitchAPI api, int checkIntervalInSeconds)
 Constructor from the ApiService. More...
 
virtual void SetChannels (List< string > channelsToMonitor)
 Sets channels by to monitor. More...
 
virtual Task OnServiceTimerTick ()
 Called when the service timer ticks. Invokes the OnServiceTick event. More...
 

Protected Attributes

readonly ITwitchAPI _api
 

Properties

List< string > ChannelsToMonitor [get]
 The list with channels to monitor. More...
 
int IntervalInSeconds [get]
 How often the service is being updated in seconds. More...
 
bool Enabled [get]
 Whether the service is currently enabled or not. More...
 

Events

EventHandler< OnServiceStartedArgsOnServiceStarted
 Event invoked when the service has started. More...
 
EventHandler< OnServiceStoppedArgsOnServiceStopped
 Event invoked when the service has stopped. More...
 
EventHandler< OnServiceTickArgsOnServiceTick
 Event invoked when the service is updating. More...
 
EventHandler< OnChannelsSetArgsOnChannelsSet
 Event invoked when the channels have been set. More...
 

Constructor & Destructor Documentation

◆ ApiService()

TwitchLib.Api.Services.ApiService.ApiService ( ITwitchAPI  api,
int  checkIntervalInSeconds 
)
protected

Constructor from the ApiService.

Exceptions
ArgumentNullExceptionWhen the api is null.
ArgumentExceptionWhen the checkIntervalInSeconds is lower than one second.
Parameters
apiThe api used to query information.
checkIntervalInSeconds

Member Function Documentation

◆ OnServiceTimerTick()

virtual Task TwitchLib.Api.Services.ApiService.OnServiceTimerTick ( )
protectedvirtual

Called when the service timer ticks. Invokes the OnServiceTick event.

Reimplemented in TwitchLib.Api.Services.FollowerService, and TwitchLib.Api.Services.LiveStreamMonitorService.

◆ SetChannels()

virtual void TwitchLib.Api.Services.ApiService.SetChannels ( List< string >  channelsToMonitor)
protectedvirtual

Sets channels by to monitor.

Exceptions
ArgumentNullExceptionWhen channelsToMonitor is null.
ArgumentExceptionWhen channelsToMonitor is empty.
Parameters
channelsToMonitorThe channels to monitor.

◆ Start()

virtual void TwitchLib.Api.Services.ApiService.Start ( )
virtual

Starts the service.

Exceptions
InvalidOperationExceptionWhen no channels have been added to the service
InvalidOperationExceptionWhen the service has already been started.

◆ Stop()

virtual void TwitchLib.Api.Services.ApiService.Stop ( )
virtual

Stops the service.

Exceptions
InvalidOperationExceptionWhen the service hasn't started yet, or has already been stopped.

Member Data Documentation

◆ _api

readonly ITwitchAPI TwitchLib.Api.Services.ApiService._api
protected

Property Documentation

◆ ChannelsToMonitor

List<string> TwitchLib.Api.Services.ApiService.ChannelsToMonitor
get

The list with channels to monitor.

◆ Enabled

bool TwitchLib.Api.Services.ApiService.Enabled
get

Whether the service is currently enabled or not.

◆ IntervalInSeconds

int TwitchLib.Api.Services.ApiService.IntervalInSeconds
get

How often the service is being updated in seconds.

Event Documentation

◆ OnChannelsSet

EventHandler<OnChannelsSetArgs> TwitchLib.Api.Services.ApiService.OnChannelsSet

Event invoked when the channels have been set.

◆ OnServiceStarted

EventHandler<OnServiceStartedArgs> TwitchLib.Api.Services.ApiService.OnServiceStarted

Event invoked when the service has started.

◆ OnServiceStopped

EventHandler<OnServiceStoppedArgs> TwitchLib.Api.Services.ApiService.OnServiceStopped

Event invoked when the service has stopped.

◆ OnServiceTick

EventHandler<OnServiceTickArgs> TwitchLib.Api.Services.ApiService.OnServiceTick

Event invoked when the service is updating.


The documentation for this class was generated from the following file: