WorkItem Class
Represents a work item on Team Foundation Server.
Inheritance Hierarchy
System.Object
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem
Namespace: Microsoft.TeamFoundation.WorkItemTracking.Client
Assembly: Microsoft.TeamFoundation.WorkItemTracking.Client (in Microsoft.TeamFoundation.WorkItemTracking.Client.dll)
Syntax
'Declaration
Public NotInheritable Class WorkItem
public sealed class WorkItem
public ref class WorkItem sealed
[<Sealed>]
type WorkItem = class end
public final class WorkItem
The WorkItem type exposes the following members.
Constructors
Name | Description | |
---|---|---|
WorkItem | Initializes a new instance of the WorkItem class of the specified WorkItemType. |
Top
Properties
Name | Description | |
---|---|---|
AreaId | Gets or sets the integer value of the AreaId field for this work item. | |
AreaPath | Gets or sets the string value of the AreaPath field for this work item. | |
AttachedFileCount | Gets the number of attached files for this work item. | |
Attachments | Gets the AttachmentCollection object that represents the attachments that belong to this work item. | |
ChangedBy | Gets the string value of the ChangedBy field for this work item. | |
ChangedDate | Gets the DateTime object that represents the date and time that this work item was last changed. | |
CreatedBy | Gets the string value of the CreatedBy field for this work item. | |
CreatedDate | Gets the DateTime object that represents the date and time that this work item was created. | |
Description | Gets or sets a string that describes this work item. | |
DisplayForm | Gets the display form that is associated with this work item. | |
ExternalLinkCount | Gets the number of external links in this work item. | |
Fields | Gets the FieldCollection object that contains the Fields of this work item. | |
History | Gets or sets the string value of the History field for this work item. | |
HyperLinkCount | Gets the number of hyperlinks in this work item. | |
Id | Gets the ID of this work item. | |
IsDirty | Gets a flag that describes whether this work item has been changed since its last save. | |
IsNew | Gets a flag that describes whether this work item is new. | |
IsOpen | Gets a flag that describes whether this work item is currently open for edit. | |
IsPartialOpen | Gets a flag that describes whether the work item is partially opened. | |
IsReadOnly | Gets a flag that describes whether the work item is read-only. | |
IsReadOnlyOpen | Gets a flag that describes whether the work item is open as read-only. | |
Item[String] | Gets or sets the value of a field in this work item that is specified by the field name. | |
Item[CoreField] | Gets or sets the value of a field in this work item that is specified by the field ID. | |
IterationId | Gets or sets the integer value of the IterationId field of this work item. | |
IterationPath | Gets or sets the string value of the IterationPath field of this work item. | |
Links | Gets the collection of the links in this work item. | |
NodeName | Gets or sets the string value of the NodeName field of this work item. | |
Project | Gets the current project that is associated with this work item. | |
Reason | Gets or sets the string value of the Reason field for this work item. | |
RelatedLinkCount | Gets the number of related links of this work item. | |
Rev | Gets the integer that represents the revision number of this work item. | |
RevisedDate | Gets a DateTime object that represents the revision date and time of this work item. | |
Revision | Gets the integer that represents the revision number of this work item. | |
Revisions | Gets a RevisionCollection object that represents a collection of valid revision numbers for this work item. | |
State | Gets or sets a string that describes the state of this work item. | |
Store | Gets the WorkItemStore to which this work item belongs. | |
TemporaryId | Gets the temporary ID of this work item. | |
Title | Gets or sets a string that describes the title of this work item. | |
Type | Gets a WorkItemType object that represents the type of this work item. | |
Uri | Gets the uniform resource identifier (Uri) of this work item. | |
WorkItemLinkHistory | Gets a WorkItemLinkCollection object that represents a collection of the WorkItemLinks that link to this work item now or linked to it in the past. | |
WorkItemLinks | Gets a WorkItemLinkCollection object that represents a collection of the WorkItemLinks that currently link to this work item. |
Top
Methods
Name | Description | |
---|---|---|
Close | Closes this WorkItem instance and frees memory that is associated with it. | |
Copy() | Creates a copy of this WorkItem instance. | |
Copy(WorkItemType) | Creates a copy of this WorkItem instance that is of the specified WorkItemType. | |
Copy(WorkItemType, WorkItemCopyFlags) | Creates a copy of this WorkItem instance that is of the specified WorkItemType. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetNextState | Gets the next state of this work item based on the action of a user. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsValid | Validates the fields of this work item. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Open | Opens this work item for modification. | |
PartialOpen | Opens this work item for modification when transmitting minimal amounts of data over the network. | |
Reset | Reverts all changes that were made since the last save. | |
Save() | Saves any pending changes on this work item. | |
Save(SaveFlags) | Saves any pending changes on this work item. | |
SyncToLatest | Synchronizes the work item to the latest revision. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Validate | Gets an ArrayList of fields in this work item that are not valid. |
Top
Events
Name | Description | |
---|---|---|
FieldChanged | Occurs when a field is updated in this WorkItem instance. |
Top
Remarks
The following methods to access the fields and field values are available:
WorkItem["field-name"] gets/sets the value of a field.
WorkItem.Fields["field-name"] gets/sets the field, not the value.
WorkItem.Fields["field-name"].Value gets/sets the value of the field.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.