• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

[tfs]workitemtrackingsourcecode

mysql 搞代码 4年前 (2022-01-09) 28次浏览 已收录 0个评论

在编程时经常会遇到一些错误,例如,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内部是如何实现的。
namespaceMicrosoft.TeamFoundation.WorkItemTracking.Client{ usingMicrosoft.TeamFoundation; usingMicrosoft.TeamFoundation.Client; usingMicrosoft.TeamFoundation.Common; usingMicrosoft.TeamFoundation.WorkItemTracking.Client.DataStore; usingMicrosoft.TeamFoundation.WorkItemTracking.Proxy; usingSystem; usingSystem.Collections; usingSystem.Collections.Generic; usingSystem.Globalization; usingSystem.IO; usingSystem.Reflection; usingSystem.Runtime.InteropServices; usingSystem.Threading; usingSystem.Xml; publicsealedclassWorkItem : IRevisionInternal { internalconstintc_revisionHistory = -4; internalconstintc_revisionLatest = -3; internalconstintc_revisionNull = -1; internalconstintc_revisionUpdate = -2; privateDateTime? m_asof; privateAttachmentCollection m_attachments; privateintm_dataVersion; privatebool? m_dirty; privateFieldCollection m_fields; privateWorkItemFieldData m_fieldsData; privateintm_id; privateintm_index; privateboolm_IsUpdating; privateLinkCollection m_links; privateWorkItemLinkData m_linksData; privateWorkItemCollection m_list; privateintm_metadataVersion; privateOpenState m_openState; privateMicrosoft.TeamFoundation.WorkItemTracking.Client.Project m_project; privatebool? m_readonly; privateRevisionCollection m_revisions; privateWorkItemStore m_store; privateintm_tempId; privateWorkItemType m_type; privateWorkItemLinkCollection m_wlinks; privateWorkItemLinkCollection m_wlinksHistory; privatestaticint[] s_areaDependentFieldIds =newint[] { -12, -42, -43, -44, -45, -46, -47, -48, -49 }; internalstaticint[] s_internallyCalculatedFieldIds =newint[] { -7, -12, -42, -43, -44, -45, -46, -47, -48, -49, -105, -50, -51, -52, -53, -54, -55, -56 }; privatestaticint[] s_iterationDependentFieldIds =newint[] { -50, -51, -52, -53, -54, -55, -56 }; privatestaticints_tempId = 0; publiceventWorkItemFieldChangeEventHandler FieldChanged; publicWorkItem(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) { thrownewArgumentNullException("type"); } this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_store = type.Store; this.m_id = 0; this.m_tempId = Interlocked.Decrement(refs_tempId); this.m_openState = OpenState.New; this.m_readonly =false; this.InitNew(type); this.ApplyRules(); this.m_dirty =true; Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemCollection list,intindex) { this.m_dirty =false; this.m_readonly =null; this.m_asof =null; this.m_store = list.Store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_id = list.GetId(index); this.m_tempId =this.m_id; this.m_list = list; this.m_index = index; this.m_openState = OpenState.Queried; if(!list.Query.IsBatchReadMode) { this.m_asof =newDateTime?(list.Query.AsOfUTC); } } internalWorkItem(WorkItemStore store,intid) { 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, int id)"); if(store ==null) { thrownewArgumentNullException("store"); } if(id <= 0) { thrownewArgumentOutOfRangeException("id"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_id = id; this.m_tempId = id; this.LoadWorkItem(id, 0,null); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemStore store, System.Uri uri) { 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, Uri uri)"); if(store ==null) { thrownewArgumentNullException("store"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); if(!this.IsValidUri(uri)) { thrownewArgumentException("uri"); } ArtifactId artifact =this.GetArtifact(uri); this.m_id = Convert.ToInt32(artifact.ToolSpecificId, CultureInfo.InvariantCulture); this.m_tempId =this.m_id; this.LoadWorkItem(this.m_id, 0,null); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemStore store,intid, DateTime at) { 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, int id, DateTime at)"); if(store ==null) { thrownewArgumentNullException("store"本文来源[email protected]搞@^&代*@码2网); } if(id <= 0) { thrownewArgumentOutOfRangeException("id"); } DateTime time = store.ConvertToUniversalTime(at); if((time <newDateTime(0x76c, 1, 1)) || (time >= DateTime.MaxValue)) { thrownewArgumentOutOfRangeException("at"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_id = id; this.m_tempId = id; this.LoadWorkItem(id, 0,newDateTime?(time)); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemStore store,intid, int revision) { 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, int id, int revision)"); if(store ==null) { thrownewArgumentNullException("store"); } if(id <= 0) { thrownewArgumentOutOfRangeException("id"); } if(revision <= 0) { thrownewArgumentOutOfRangeException("revision"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_id = id; this.m_tempId = id; this.LoadWorkItem(id, revision,null); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemStore store, System.Uri uri, DateTime at) { 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, Uri uri, DateTime at)"); if(store ==null) { thrownewArgumentNullException("store"); } DateTime time = store.ConvertToUniversalTime(at); if((time <newDateTime(0x76c, 1, 1)) || (time >= DateTime.MaxValue)) { thrownewArgumentOutOfRangeException("at"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); if(!this.IsValidUri(uri)) { thrownewArgumentException("uri"); } ArtifactId artifact =this.GetArtifact(uri); this.m_id = Convert.ToInt32(artifact.ToolSpecificId, CultureInfo.InvariantCulture); this.m_tempId =this.m_id; this.LoadWorkItem(this.m_id, 0,newDateTime?(time)); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalWorkItem(WorkItemStore store, System.Uri uri,intrevision) { 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, Uri uri, int revision)"); if(store ==null) { thrownewArgumentNullException("store"); } if(revision <= 0) { thrownewArgumentOutOfRangeException("revision"); } this.m_store = store; this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); if(!this.IsValidUri(uri)) { thrownewArgumentException("uri"); } ArtifactId artifact =this.GetArtifact(uri); this.m_id = Convert.ToInt32(artifact.ToolSpecificId, CultureInfo.InvariantCulture); this.m_tempId =this.m_id; this.LoadWorkItem(this.m_id, revision,null); this.ApplyRules(); Microsoft.TeamFoundation.Common.Marker.Process(Microsoft.TeamFoundation.Common.Mark.OMWorkItemNewEnd); } internalvoidApplyFieldChange(intfieldId,objectvalue) { BrieCallBack bc =newBrieCallBack(this); WorkItemFieldData.FieldUpdate update =newWorkItemFieldData.FieldUpdate(); update.Value = value; update.Flags = 0; bc.FieldUpdates.Add(fieldId, update); this.ApplyFieldChange(fieldId, bc, 2); bc.FieldUpdates.Remove(fieldId); this.FieldData.SetFieldValues(bc.FieldUpdates); this.Store.PsDatastore.BrieAccessCheck(bc, 1, fieldId); this.FieldData.SetFieldStates(bc.FieldStates); } privatevoidApplyFieldChange(intfieldId, BrieCallBack bc,intrecursive) { if(fieldId != 0) { this.Store.PsDatastore.BrieInvalidateFields(bc, fieldId); bc.SetFieldUpdateFlags(WorkItemFieldData.FieldFlags.SetByDefaultRule); this.Store.PsDatastore.BrieAccessCheck(bc, 0x80, fieldId); bc.SetFieldUpdateFlags(0); this.Store.PsDatastore.BrieAccessCheck(bc, 0x40, fieldId); } Dictionary<int,bool=""> dictionary = bc.ResetChanges(); if(recursive > 0) { foreach(intnum in dictionary.Keys) { this.ApplyFieldChange(num, bc, recursive - 1); } } } internalvoidApplyRules() { this.ApplyRules(true); } internalvoidApplyRules(boolfSetChangedBy) { this.FieldData.ResetChangedFields(); BrieCallBack callback =newBrieCallBack(this); callback.SetFieldUpdateFlags(WorkItemFieldData.FieldFlags.SetByDefaultRule); this.Store.PsDatastore.BrieAccessCheck(callback, 0x80, 0); callback.SetFieldUpdateFlags(0); this.Store.PsDatastore.BrieAccessCheck(callback, 0x20, 0); this.ApplyFieldChange(0, callback, 2); this.FieldData.SetFieldValues(callback.FieldUpdates); this.Store.PsDatastore.BrieAccessCheck(callback, 1, 0); this.FieldData.SetAllFieldStates(callback.FieldStates); if(fSetChangedBy) { intid = 9; stringuserDisplayName =this.m_store.UserDisplayName; if(this.FieldData.SetUpdateFieldValue(id, userDisplayName, WorkItemFieldData.FieldFlags.SetByRule)) { this.ApplyFieldChange(id, userDisplayName); } } this.FieldData.FireEvents(); } privateobjectCalculateAuthorizedAsField(intrevision) { objectfieldValue =this.GetFieldValue(-6, revision); if(fieldValueisint) { returnthis.m_store.GetPersonNameById((int) fieldValue); } returnfieldValue; } internalvoidCalculateFieldLists(intfieldId) { BrieCallBack callback =newBrieCallBack(this); this.Store.PsDatastore.BrieAccessCheck(callback, 0x17, fieldId); this.FieldData.SetFieldStates(callback.FieldStates); } privateobjectCalculateNodeNameField(intfname,int fid, int revision) { objectfieldValue =this.GetFieldValue(fid, revision); if(fieldValueisint) { returnthis.m_store.TreeIdToNodeName((int) fieldValue); } returnfieldValue; } privateobjectCalculateTreeLevelField(intflevel,intflevel1,intfid, int revision) { objectfieldValue =this.GetFieldValue(fid, revision); if(fieldValueisint) { returnthis.m_store.TreeIdToNodeLevel((int) fieldValue, (flevel1 - flevel) + 1); } returnfieldValue; } privateobjectCalculateTreePathField(intfpath,int fid, int revision) { objectfieldValue =this.GetFieldValue(fid, revision); if(fieldValueisint) { returnthis.m_store.TreeIdToPath((int) fieldValue); } returnfieldValue; } privatevoidCheckType() { WorkItemType type =this.Type; } privatevoidCheckUpdateCachedData() { boolflag =false; if(this.m_store.MetadataVersion !=this.m_metadataVersion) { flag =true; } intmetadataVersion =this.m_store.MetadataVersion; if(this.m_project ==null) { objectfieldValue =this.GetFieldValue(-2, -2); if(fieldValue !=null) { this.m_project =this.m_store.TreeIdToProject((int) fieldValue); } } elseif(flag) { this.m_project =this.m_store.Projects.GetById(this.m_project.Id); this.m_type =null; } if((this.m_type ==null) && (this.m_project !=null)) { stringstr = (string)this.GetFieldValue(0x19, -2); if(!string.IsNullOrEmpty(str) &&this.m_project.WorkItemTypes.Contains(str)) { this.m_type =this.m_project.WorkItemTypes[str]; } } this.m_metadataVersion = metadataVersion; } publicvoidClose() { if(!this.IsNew) { this.m_fieldsData =newWorkItemFieldData(this); this.m_linksData =newWorkItemLinkData(this); this.m_revisions =null; this.m_attachments =null; this.m_links =null; this.m_wlinks =null; this.m_wlinksHistory =null; this.m_fields =null; if(this.m_list !=null) { this.m_openState = OpenState.Queried; } else { this.m_openState = OpenState.Undefined; } } } internalvoidConvertFieldValueToExternal(refobjectvalue, System.Type type) { if((value ==null) && (type ==typeof(string))) { value =string.Empty; } elseif(value isDateTime) { value =this.Store.ConvertToLocalTime((DateTime) value); } } internalWorkItemFieldData.FieldFlags ConvertFieldValueToInternal(refobjectvalue, System.Type type) { if(value ==null) { return0; } try { objectobj2 = value; if(value.GetType() != type) { if((type ==typeof(Guid)) && (valueisstring)) { obj2 =newGuid((string) value); }


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:[tfs]workitemtrackingsourcecode
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址