Click or drag to resize

BasicWorkItem Class

This class provides base functionality for a work item, only the abstract method HandleWorkItem has to be implemented to start things
Inheritance Hierarchy
SystemObject
  Jam.ShellBasicWorkItem

Namespace:  Jam.Shell
Assembly:  ShellBrowser.Core (in ShellBrowser.Core.dll) Version: 7.0
Syntax
public abstract class BasicWorkItem : IWorkItem

The BasicWorkItem type exposes the following members.

Constructors
  NameDescription
Protected methodBasicWorkItem
Standard constructor
Protected methodBasicWorkItem(Boolean)
Allowing to abort is disabled per default since thread aborting results in unstable system state, see http://msdn.microsoft.com/en-us/magazine/cc163644.aspx : [..] "I'll caution you against using Thread.Abort to control the lifetime of a thread, especially if you have little knowledge about the implementation of the code you're aborting. An abort inside of a critical region could spell disaster for an entire AppDomain, and while a polite abort does signficantly reduce the window of disaster to very tiny slivers, that one time out of 1,000 could lead to a deadlock or resource leak or worse."
Top
Properties
  NameDescription
Public propertyAllowAbortUponExceedingTimeLimit
Whether to allow aborting the HandleWorkItem method if the maximum busy time exceeded. Per default this value is true.
Public propertyIsTerminated
This property is set to true if the work item was terminated before it finished processing, this may happen e.g. if AllowAbortUponExceedingTimeLimit was true.
Public propertyMaxBusyTime
The maximum time a workItem may be busy until it is aborted. Must be > 0 to be taken into account.
Public propertyResult
The result of the work item
Public propertyTag
A work item can be tagged to be distinguishable from other items
Top
Methods
  NameDescription
Public methodDoWork
This method is called from HandleWorkItem when the work item is processed. May set Result if the operation returned a result
Public methodHandleWorkItem
Calls HandleWorkItem method, then after the call to the method returns, issues the event WorkDone if assigned
Public methodTerminate
Sets the state of the item (IsTerminated to true), issues the Terminated event if assigned.
Public methodToString
Returns the Tag as string.
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventTerminated
This event occurs if the item terminated before it finished processing. IsTerminated and AllowAbortUponExceedingTimeLimit
Public eventWorkDone
Register to this event to get notified when the item HandleWorkItem method has finished.
Top
See Also