Class StateService
Represents a service that is state-based. E.g. it may start, perform some action and stop.
Inherited Members
Namespace: Telerik.WinControls.UI.Docking
Assembly: Telerik.WinControls.RadDock.dll
Syntax
public abstract class StateService : RadDockService, IDisposable, INotifyPropertyChanged, INotifyPropertyChangingEx
Constructors
StateService()
Default constructor.
Declaration
public StateService()
Properties
AvailableAtDesignTime
Determines whether the service is available at design-time. False by default.
Declaration
public virtual bool AvailableAtDesignTime { get; }
Property Value
System.Boolean
|
Context
Gets the context associated with the current operation. This member is valid only while the Service is started or paused.
Declaration
public object Context { get; }
Property Value
System.Object
|
State
Gets the current state of the service.
Declaration
public ServiceState State { get; }
Property Value
ServiceState
|
Methods
Abort()
Aborts the current operation without applying any changes.
Declaration
protected virtual void Abort()
CanStart(Object)
Determines whether the service may be started. Validation is as follows:
- Check whether Enabled is true.
- Check the context through IsContextValid method. An exception is thrown if context is invalid.
- Checks the current state - it should be Initial or Stopped.
Declaration
protected virtual bool CanStart(object context)
Parameters
System.Object
context
|
Returns
System.Boolean
|
Commit()
Ends the current operation and applies all changes.
Declaration
protected virtual void Commit()
IsContextValid(Object)
Evaluates the provided context. Some services may not operate without certain context provided.
Declaration
protected virtual bool IsContextValid(object context)
Parameters
System.Object
context
|
Returns
System.Boolean
|
OnDockManagerChanged()
Provides additional processing when a change in the owning RadDock instance occurs.
Declaration
protected override void OnDockManagerChanged()
Overrides
OnEnabledChanged()
Provides additional processing for a change in the Enabled state.
Declaration
protected override void OnEnabledChanged()
Overrides
OnStarted()
Notifies that the service has been successfully started. Allows inheritors to perform some additional logic upon start.
Declaration
protected virtual void OnStarted()
OnStarting(StateServiceStartingEventArgs)
Notifies that a start request has occured. Cancelable.
Declaration
protected virtual void OnStarting(StateServiceStartingEventArgs e)
Parameters
StateServiceStartingEventArgs
e
|
OnStopped()
Notifies that a running operation has stopped. Allows inheritors to perform some additional logic upon stop.
Declaration
protected virtual void OnStopped()
OnStopping(StateServiceStoppingEventArgs)
Notifies that a stop request has occured. Cancelable.
Declaration
protected virtual void OnStopping(StateServiceStoppingEventArgs e)
Parameters
StateServiceStoppingEventArgs
e
|
Pause()
Pauses a currently running operation.
Declaration
public void Pause()
PerformPause()
Performs the core Pause logic.
Declaration
protected virtual void PerformPause()
PerformResume()
Performs the core Resume logic.
Declaration
protected virtual void PerformResume()
PerformStart()
Performs the core Start logic.
Declaration
protected virtual void PerformStart()
PerformStop()
Stops the service. Performs the core logic.
Declaration
protected virtual void PerformStop()
Resume()
Resumes previously paused operation.
Declaration
public void Resume()
SetContext(Object)
Sets the provided object as the current context.
Declaration
protected virtual void SetContext(object context)
Parameters
System.Object
context
|
Start(Object)
Starts the Service. If the service was previously paused, it should be re-started with the Resume method.
Declaration
public void Start(object context)
Parameters
System.Object
context
|
Stop(Boolean)
Stops currently working or previously stopped service.
Declaration
public void Stop(bool commit)
Parameters
System.Boolean
commit
True to indicate that current operation ended successfully, false otherwise. |
Events
Started
Raised right after the service is started.
Declaration
public event EventHandler Started
Event Type
System.EventHandler
|
Starting
Raised when the service is about to be started.
Declaration
public event StateServiceStartingEventHandler Starting
Event Type
StateServiceStartingEventHandler
|
Stopped
Raised when the service is stopped.
Declaration
public event EventHandler Stopped
Event Type
System.EventHandler
|
Stopping
Raised when the service is about to be stopped.
Declaration
public event StateServiceStoppingEventHandler Stopping
Event Type
StateServiceStoppingEventHandler
|