在编程时经常会遇到一些错误,例如,http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.fieldstatus.aspx 上面所列出的错误,简单的通过描述无法确认真的问题所在,那么你就需要查看server内部是如何实现的。 names
在编程时经常会遇到一些错误,例如,http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.fieldstatus.aspx 上面所列出的错误,简单的通过描述无法确认真的问题所在,那么你就需要查看server内部是如何实现的。namespace
Microsoft.TeamFoundation.WorkItemTracking.Client
{
using
Microsoft.TeamFoundation;
using
Microsoft.TeamFoundation.Client;
using
Microsoft.TeamFoundation.Common;
using
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore;
using
Microsoft.TeamFoundation.WorkItemTracking.Proxy;
using
System;
using
System.Collections;
using
System.Collections.Generic;
using
System.Globalization;
using
System.IO;
using
System.Reflection;
using
System.Runtime.InteropServices;
using
System.Threading;
using
System.Xml;
public
sealed
class
WorkItem : IRevisionInternal
{
internal
const
int
c_revisionHistory = -4;
internal
const
int
c_revisionLatest = -3;
internal
const
int
c_revisionNull = -1;
internal
const
int
c_revisionUpdate = -2;
private
DateTime? m_asof;
private
AttachmentCollection m_attachments;
private
int
m_dataVersion;
private
bool
? m_dirty;
private
FieldCollection m_fields;
private
WorkItemFieldData m_fieldsData;
private
int
m_id;
private
int
m_index;
private
bool
m_IsUpdating;
private
LinkCollection m_links;
private
WorkItemLinkData m_linksData;
private
WorkItemCollection m_list;
private
int
m_metadataVersion;
private
OpenState m_openState;
private
Microsoft.TeamFoundation.WorkItemTracking.Client.Project m_project;
private
bool
? m_readonly;
private
RevisionCollection m_revisions;
private
WorkItemStore m_store;
private
int
m_tempId;
private
WorkItemType m_type;
private
WorkItemLinkCollection m_wlinks;
private
WorkItemLinkCollection m_wlinksHistory;
private
static
int
[] s_areaDependentFieldIds =
new
int
[] { -12, -42, -43, -44, -45, -46, -47, -48, -49 };
internal
static
int
[] s_internallyCalculatedFieldIds =
new
int
[] {
-7, -12, -42, -43, -44, -45, -46, -47, -48, -49, -105, -50, -51, -52, -53, -54,
-55, -56
};
private
static
int
[] s_iterationDependentFieldIds =
new
int
[] { -50, -51, -52, -53, -54, -55, -56 };
private
static
int
s_tempId = 0;
public
event
WorkItemFieldChangeEventHandler FieldChanged;
public
WorkItem(WorkItemType type)
{
this
.m_dirty =
false
;
this
.m_readonly =
null
;
this
.m_asof =
null
;
Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewBegin);
TeamFoundationTrace.Verbose(
"Entering WorkItem(WorkItemStore store, WorkItemType type)"
);
if
(type ==
null
)
{
throw
new
ArgumentNullException(
"type"
);
}
this
.m_fieldsData =
new
WorkItemFieldData(
this
);
this
.m_linksData =
new
WorkItemLinkData(
this
);
this
.m_store = type.Store;
this
.m_id = 0;
this
.m_tempId = Interlocked.Decrement(