Class
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:

cs-api-definition
public abstract class StateService : RadDockService, IDisposable, INotifyPropertyChanged, INotifyPropertyChangingEx

Inheritance: objectRadDockObjectRadDockServiceStateService

Derived Classes: DragDropService

Implements: IDisposableINotifyPropertyChangedINotifyPropertyChangingEx

Inherited Members RadDockService.CanOperate()RadDockService.DockManagerDesignModeRadDockService.DockManagerRadDockService.EnabledRadDockObject.Dispose()RadDockObject.Dispose(bool)RadDockObject.DisposeManagedResources()RadDockObject.DisposeUnmanagedResources()RadDockObject.OnPropertyChanging(string)RadDockObject.OnPropertyChanged(string)RadDockObject.ShouldSerializeProperty(string)RadDockObject.EventsRadDockObject.DisposingRadDockObject.IsDisposedRadDockObject.DisposedRadDockObject.PropertyChangingRadDockObject.PropertyChanged

Constructors

StateService()

Default constructor.

Declaration

cs-api-definition
public StateService()

Properties

AvailableAtDesignTime

Determines whether the service is available at design-time. False by default.

Declaration

cs-api-definition
public virtual bool AvailableAtDesignTime { get; }

Property Value

bool

Context

Gets the context associated with the current operation. This member is valid only while the Service is started or paused.

Declaration

cs-api-definition
public object Context { get; }

Property Value

object

State

Gets the current state of the service.

Declaration

cs-api-definition
public ServiceState State { get; }

Property Value

ServiceState

Methods

Abort()

Aborts the current operation without applying any changes.

Declaration

cs-api-definition
protected virtual void Abort()

CanStart(object)

Determines whether the service may be started. Validation is as follows:

  1. Check whether Enabled is true.
  2. Check the context through IsContextValid method. An exception is thrown if context is invalid.
  3. Checks the current state - it should be Initial or Stopped.

Declaration

cs-api-definition
protected virtual bool CanStart(object context)

Parameters

context

object

Returns

bool

Commit()

Ends the current operation and applies all changes.

Declaration

cs-api-definition
protected virtual void Commit()

IsContextValid(object)

Evaluates the provided context. Some services may not operate without certain context provided.

Declaration

cs-api-definition
protected virtual bool IsContextValid(object context)

Parameters

context

object

Returns

bool

OnDockManagerChanged()

Provides additional processing when a change in the owning RadDock instance occurs.

Declaration

cs-api-definition
protected override void OnDockManagerChanged()

Overrides RadDockService.OnDockManagerChanged()

OnEnabledChanged()

Provides additional processing for a change in the Enabled state.

Declaration

cs-api-definition
protected override void OnEnabledChanged()

Overrides RadDockService.OnEnabledChanged()

OnStarted()

Notifies that the service has been successfully started. Allows inheritors to perform some additional logic upon start.

Declaration

cs-api-definition
protected virtual void OnStarted()

OnStarting(StateServiceStartingEventArgs)

Notifies that a start request has occured. Cancelable.

Declaration

cs-api-definition
protected virtual void OnStarting(StateServiceStartingEventArgs e)

Parameters

e

StateServiceStartingEventArgs

OnStopped()

Notifies that a running operation has stopped. Allows inheritors to perform some additional logic upon stop.

Declaration

cs-api-definition
protected virtual void OnStopped()

OnStopping(StateServiceStoppingEventArgs)

Notifies that a stop request has occured. Cancelable.

Declaration

cs-api-definition
protected virtual void OnStopping(StateServiceStoppingEventArgs e)

Parameters

e

StateServiceStoppingEventArgs

Pause()

Pauses a currently running operation.

Declaration

cs-api-definition
public void Pause()

PerformPause()

Performs the core Pause logic.

Declaration

cs-api-definition
protected virtual void PerformPause()

PerformResume()

Performs the core Resume logic.

Declaration

cs-api-definition
protected virtual void PerformResume()

PerformStart()

Performs the core Start logic.

Declaration

cs-api-definition
protected virtual void PerformStart()

PerformStop()

Stops the service. Performs the core logic.

Declaration

cs-api-definition
protected virtual void PerformStop()

Resume()

Resumes previously paused operation.

Declaration

cs-api-definition
public void Resume()

SetContext(object)

Sets the provided object as the current context.

Declaration

cs-api-definition
protected virtual void SetContext(object context)

Parameters

context

object

Start(object)

Starts the Service. If the service was previously paused, it should be re-started with the Resume method.

Declaration

cs-api-definition
public void Start(object context)

Parameters

context

object

Stop(bool)

Stops currently working or previously stopped service.

Declaration

cs-api-definition
public void Stop(bool commit)

Parameters

commit

bool

True to indicate that current operation ended successfully, false otherwise.

Events

Started

Raised right after the service is started.

Declaration

cs-api-definition
public event EventHandler Started

Event Value

EventHandler

Starting

Raised when the service is about to be started.

Declaration

cs-api-definition
public event StateServiceStartingEventHandler Starting

Event Value

StateServiceStartingEventHandler

Stopped

Raised when the service is stopped.

Declaration

cs-api-definition
public event EventHandler Stopped

Event Value

EventHandler

Stopping

Raised when the service is about to be stopped.

Declaration

cs-api-definition
public event StateServiceStoppingEventHandler Stopping

Event Value

StateServiceStoppingEventHandler