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