Click or drag to resize

SynchronizedOperationBase Class

Base class for operations that cannot run while they is already in progress.
Inheritance Hierarchy
SystemObject
  GSF.ThreadingSynchronizedOperationBase
    More

Namespace: GSF.Threading
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public abstract class SynchronizedOperationBase : ISynchronizedOperation
View Source

The SynchronizedOperationBase type exposes the following members.

Constructors
 NameDescription
Protected methodSynchronizedOperationBase(Action) Creates a new instance of the SynchronizedOperationBase class.
Protected methodSynchronizedOperationBase(Action, ActionException) Creates a new instance of the SynchronizedOperationBase class.
Top
Properties
 NameDescription
Public propertyIsPending Gets a value to indiate whether the synchronized operation has an additional operation that is pending execution after the currently running action has completed.
Public propertyIsRunning Gets a value to indicate whether the synchronized operation is currently executing its action.
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodExecuteAction Executes the action once on the current thread.
Protected methodExecuteActionAsync Executes the action on a separate thread.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRun Executes the action on this thread or marks the operation as pending if the operation is already running.
Public methodRunOnce Executes the action on this thread or marks the operation as pending if the operation is already running.
Public methodRunOnceAsync Executes the action on another thread or marks the operation as pending if the operation is already running.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryRun Attempts to execute the action on this thread. Does nothing if the operation is already running.
Public methodTryRunOnce Attempts to execute the action on this thread. Does nothing if the operation is already running.
Public methodTryRunOnceAsync Attempts to execute the action on another thread. Does nothing if the operation is already running.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class handles the synchronization between the methods defined in the ISynchronizedOperation interface. Implementers should only need to implement the ExecuteActionAsync method to provide a mechanism for executing the action on a separate thread.
See Also
Inheritance Hierarchy