New to Telerik UI for WinFormsStart a free 30-day trial

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

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
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

Initializes a new instance of the RadService class.

C#
protected RadService()
Remarks:

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

Properties

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

C#
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.

C#
public object Context { get; }

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

C#
public bool Enabled { get; set; }

Gets the name of the service.

C#
public virtual string Name { get; }

Gets the current state of the service.

C#
public RadServiceState State { get; }

Methods

Aborts the current operation without applying any changes.

C#
protected virtual void Abort()

Determines whether the service is operational and may perform actions.

C#
public virtual bool CanOperate()
Returns:

bool

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.
C#
protected virtual bool CanStart(object context)
Parameters:contextobjectReturns:

bool

Ends the current operation and applies all changes.

C#
protected virtual void Commit()

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

C#
protected virtual bool IsContextValid(object context)
Parameters:contextobjectReturns:

bool

Notifies for a change in the Enabled state.

C#
protected virtual void OnEnabledChanged()

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

C#
protected virtual void OnStarted()

Notifies that a start request has occured. Cancelable.

C#
protected virtual void OnStarting(RadServiceStartingEventArgs e)
Parameters:eRadServiceStartingEventArgs

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

C#
protected virtual void OnStopped()

Notifies that a stop request has occured. Cancelable.

C#
protected virtual void OnStopping(RadServiceStoppingEventArgs e)
Parameters:eRadServiceStoppingEventArgs

Pauses a currently running operation.

C#
public void Pause()

Performs the core Pause logic.

C#
protected virtual void PerformPause()

Performs the core Resume logic.

C#
protected virtual void PerformResume()

Performs the core Start logic.

C#
protected virtual void PerformStart()

Stops the service. Performs the core logic.

C#
protected virtual void PerformStop()

Resumes previously paused operation.

C#
public void Resume()

Sets the provided object as the current context.

C#
protected virtual void SetContext(object context)
Parameters:contextobject

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

C#
public void Start(object context)
Parameters:contextobject

A context passed to the service.

Stops currently working or previously stopped service.

C#
public void Stop(bool commit)
Parameters:commitbool

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

Events

Raised right after the service is started.

C#
public event EventHandler Started

Raised when the service is about to be started.

C#
public event EventHandler<RadServiceStartingEventArgs> Starting

Raised when the service is stopped.

C#
public event EventHandler Stopped

Raised when the service is about to be stopped.

C#
public event EventHandler<RadServiceStoppingEventArgs> Stopping