WorkItem Members

Defines the work item into which smart parts run.

The following tables list the members exposed by the WorkItem type.

Public Constructors

  Name Description
Public method WorkItem Initializes a new instance of the WorkItem class.

Top

Public Properties

(see also Protected Properties )

  Name Description
Public property Commands List of commands registered with the WorkItem.
Public property EventTopics Returns a collection describing the EventTopic objects in this WorkItem.
Public property ID Gets/sets the ID of this WorkItem. The ID is used for persistence of the WorkItem. By default, the ID will be a GUID. If you set a new ID, the old state data will be lost and replaced with new, empty state.
Public property Items Gets a list of all the objects and services contained in this WorkItem.
Public property Parent Gets the parent WorkItem.
Public property RootWorkItem Gets the root WorkItem (the one at the top of the hierarchy).
Public property Services Returns the collection of services associated with this WorkItem.
Public property SmartParts Returns a collection describing the child smart parts (objects with the SmartPartAttribute applied to them) in this WorkItem.
Public property State Gets the State associated with this WorkItem.
Public property Status Gets the current WorkItemStatus of the WorkItem.
Public property TraceSource Sets the TraceSource used by the WorkItem to log messages.
Public property UIExtensionSites Returns a collection of UIExtensionSites in the WorkItem.
Public property WorkItems Returns a collection describing the child WorkItem objects in this WorkItem.
Public property Workspaces Returns a collection describing the IWorkspace objects in this WorkItem.

Top

Protected Properties

  Name Description
Protected property InnerBuilder Provides protected access to the builder contained within the workitem.
Protected property InnerLocator Provides protected access to the locator contained within the workitem.

Top

Public Methods

(see also Protected Methods )

  Name Description
Public method Activate Activates the WorkItem.
Public method Deactivate Deactivates the WorkItem.
Public method DeleteState Deletes the saved state of the WorkItem. The local copy of the state is not changed.
Public method Dispose Overloaded.  
Public method Equals  Overloaded. (Inherited from Object.)
Public method GetHashCode  (Inherited from Object.)
Public method GetSmartPartInfo Returns smart part information for a control.
Public method GetType  (Inherited from Object.)
Public method InitializeWorkItem Initializes the WorkItem after construction. This method is typically called by the parent WorkItem during the process of building a new child WorkItem.
Public method Load Loads the work item.
Public method OnBuiltUp See OnBuiltUp for more information.
Public method OnTearingDown See OnTearingDown for more information.
Public method Static ReferenceEquals  (Inherited from Object.)
Public method RegisterSmartPartInfo Registers a ISmartPartInfo view data for a given control.
Public method Run Runs the work item by calling the OnRunStarted method, which will raise the RunStarted event and eventually the custom starting business logic a derived class placed on it.
Public method Save Saves the state of this work item.
Public method Terminate Terminates the work item.
Public method ToString  (Inherited from Object.)

Top

Protected Methods

  Name Description
Protected method BuildUp Used when the creator of a root WorkItem needs to ensure that the WorkItem has properly built itself (so its dependencies get injected properly).
Protected method CreateCommand Called to create a new Command instance to add to the Commands collection.
Protected method CreateEventTopic Called to create a new EventTopic instance to add to the EventTopics collection.
Protected method Dispose Overloaded.  
Protected method Finalize  (Inherited from Object.)
Protected method FinishInitialization Finishes the initialization of WorkItem classes by calling the IWorkItemExtensionService and OnInitialized. For root WorkItems, this will be called by the CabApplication after the modules are loaded (so root WorkItem extensions work). For child WorkItems, this will be called during OnBuiltUp automatically.
Protected method InitializeRootWorkItem Initializes a root WorkItem. Intended to be called by the user who creates the first WorkItem using new. Subsequent child WorkItem classes are automatically initialized through dependency injection from their parent.
Protected method InitializeServices Initializes the built-in services exposed by the WorkItem.
Protected method MemberwiseClone  (Inherited from Object.)
Protected method OnActivated Fires the Activated event.
Protected method OnActivating Fires the Activating event.
Protected method OnDeactivated Fires the Deactivated event.
Protected method OnDeactivating Fires the Deactivating event.
Protected method OnDisposed Fires the Disposed event.
Protected method OnIdChanged Fires the IdChanged event.
Protected method OnInitialized Fires the Initialized event.
Protected method OnObjectAdded Fires the ObjectRemoved event.
Protected method OnObjectRemoved Fires the ObjectRemoved event.
Protected method OnRunStarted Fires the RunStarted event. Derived classes can override this method to place custom business logic to execute when the Run method is called on the WorkItem.
Protected method OnTerminated Fires the Terminated event.
Protected method OnTerminating Fires the Terminating event.

Top

Public Events

  Name Description
Public event Activated Occurs when the WorkItem is activated.
Public event Activating Occurs when the WorkItem is activating.
Public event Deactivated Occurs when the WorkItem is deactivated.
Public event Deactivating Occurs when the WorkItem is deactivated.
Public event Disposed Occurs when the WorkItem is disposed.
Public event IdChanged Occurs when the ID is changed.
Public event Initialized Occurs when the WorkItem is initialized.
Public event RunStarted Occurs when the Run method is executed.
Public event Terminated Occurs when the WorkItem is terminated.
Public event Terminating Occurs before a WorkItem is terminated.

Top

See Also

Reference

WorkItem Class
Microsoft.Practices.CompositeUI Namespace