Class
RadService

Represents an abstract base class that provides service capabilities for Telerik WinControls.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public abstract class RadService : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectRadService

Derived Classes: RadDragDropService

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing

Constructors

RadService()

Initializes a new instance of the RadService class.

Declaration

cs-api-definition
protected RadService()

Remarks

Sets the initial state to Initial and enables the service by default.

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

Enabled

Determines whether the Service is enabled (may be started). If the Service is working and its is disabled, it will end its current operation.

Declaration

cs-api-definition
public bool Enabled { get; set; }

Property Value

bool

Name

Gets the name of the service.

Declaration

cs-api-definition
public virtual string Name { get; }

Property Value

string

State

Gets the current state of the service.

Declaration

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

Property Value

RadServiceState

Methods

Abort()

Aborts the current operation without applying any changes.

Declaration

cs-api-definition
protected virtual void Abort()

CanOperate()

Determines whether the service is operational and may perform actions.

Declaration

cs-api-definition
public virtual bool CanOperate()

Returns

bool

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

OnEnabledChanged()

Notifies for a change in the Enabled state.

Declaration

cs-api-definition
protected virtual void 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(RadServiceStartingEventArgs)

Notifies that a start request has occured. Cancelable.

Declaration

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

Parameters

e

RadServiceStartingEventArgs

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(RadServiceStoppingEventArgs)

Notifies that a stop request has occured. Cancelable.

Declaration

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

Parameters

e

RadServiceStoppingEventArgs

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

A context passed to the service.

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 EventHandler<RadServiceStartingEventArgs> Starting

Event Value

EventHandler<RadServiceStartingEventArgs>

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 EventHandler<RadServiceStoppingEventArgs> Stopping

Event Value

EventHandler<RadServiceStoppingEventArgs>