本文整理汇总了C#中Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem类的典型用法代码示例。如果您正苦于以下问题:C# WorkItem类的具体用法?C# WorkItem怎么用?C# WorkItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkItem类属于Microsoft.TeamFoundation.WorkItemTracking.Client命名空间,在下文中一共展示了WorkItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RefreshWorkItems
public void RefreshWorkItems(IResultsDocument queryResultsDocument)
{
string query = queryResultsDocument.QueryDocument.QueryText;
Hashtable context = GetTfsQueryParameters(queryResultsDocument);
var tpc = visualStudioAdapter.GetCurrent();
var workItemStore = tpc.GetService<WorkItemStore>();
var workItemQuery = new Query(workItemStore, query, context);
NumericFieldDefinitions = GetNumericFieldDefinitions(workItemQuery);
if (!NumericFieldDefinitions.Any())
{
CurrentWorkItems = new WorkItem[0];
return;
}
WorkItemCollection workItemCollection = workItemStore.GetWorkItems(workItemQuery, NumericFieldDefinitions);
WorkItem[] workItemsA = new WorkItem[workItemCollection.Count];
((ICollection)workItemCollection).CopyTo(workItemsA, 0);
CurrentWorkItems = workItemsA;
RefreshTotals((queryResultsDocument.SelectedItemIds ?? new int[0]));
}
开发者ID:cqse,项目名称:ScrumPowerTools,代码行数:27,代码来源:QueryResultsTotalizerModel.cs
示例2: QueryResultsTotalizerModel
public QueryResultsTotalizerModel(IVisualStudioAdapter visualStudioAdapter)
{
this.visualStudioAdapter = visualStudioAdapter;
CurrentWorkItems = new WorkItem[0];
NumericFieldDefinitions = new FieldDefinition[0];
}
开发者ID:cqse,项目名称:ScrumPowerTools,代码行数:7,代码来源:QueryResultsTotalizerModel.cs
示例3: GetRelatedWorkItemLinks
private IEnumerable<RelatedLink> GetRelatedWorkItemLinks(WorkItem workItem)
{
return workItem.Links.Cast<Link>()
.Where(link => link.BaseType == BaseLinkType.RelatedLink)
.Select(link => link as RelatedLink)
.ToList();
}
开发者ID:benjambe,项目名称:TeamCityBuildChanges,代码行数:7,代码来源:TfsApi.cs
示例4: createChildWorkItems
/// <summary>
/// Copies the child work items from the templat work item, under parentWorkItem.
/// Currently there is no support for multiple nesting in the template. This will only copy one level deep.
/// </summary>
/// <param name="parentWorkItem"></param>
public void createChildWorkItems(WorkItem parentWorkItem, WorkItem templateWorkItem)
{
WorkItemLinkTypeEnd childLinkType = workItemStore.WorkItemLinkTypes.LinkTypeEnds["Child"];
WorkItemLinkTypeEnd parentLinkType = workItemStore.WorkItemLinkTypes.LinkTypeEnds["Parent"];
foreach(WorkItemLink itemLInk in templateWorkItem.WorkItemLinks) {
if ((itemLInk.BaseType == BaseLinkType.WorkItemLink) && (itemLInk.LinkTypeEnd == childLinkType)) {
WorkItem copyWorkItem = getWorkItem(itemLInk.TargetId);
if (!copyWorkItem["State"].Equals("Removed")) {
WorkItem newWorkItem = copyWorkItem.Copy();
newWorkItem.Title = newWorkItem.Title;
newWorkItem.IterationId = parentWorkItem.IterationId;
newWorkItem.Links.Clear();
clearHistoryFromWorkItem(newWorkItem);
//This history entry is added to the new items to prevent recursion on newly created items.
newWorkItem.History = Resources.strings.HISTORYTEXT_CLONED;
WorkItemLinkTypeEnd linkTypeEnd = parentLinkType;
newWorkItem.Links.Add(new RelatedLink(linkTypeEnd, parentWorkItem.Id));
newWorkItem.Save();
}
}
}
}
开发者ID:JohnFx,项目名称:ImprovedTFS,代码行数:34,代码来源:TFSHelper.cs
示例5: CreateWorkItem
/// <summary>
/// Creates a new work item of a defined type
/// </summary>
/// <param name="workItemType">The type name</param>
/// <param name="title">Default title</param>
/// <param name="description">Default description</param>
/// <param name="fieldsAndValues">List of extra propierties and values</param>
/// <returns></returns>
public WorkItem CreateWorkItem(string workItemType, string title, string description, Dictionary<string, object> fieldsAndValues)
{
WorkItemType wiType = workItemTypeCollection[workItemType];
WorkItem wi = new WorkItem(wiType) { Title = title, Description = description };
foreach (KeyValuePair<string, object> fieldAndValue in fieldsAndValues)
{
string fieldName = fieldAndValue.Key;
object value = fieldAndValue.Value;
if (wi.Fields.Contains(fieldName))
wi.Fields[fieldName].Value = value;
else
throw new ApplicationException(string.Format("Field not found {0} in workItemType {1}, failed to save the item", fieldName, workItemType));
}
if (wi.IsValid())
{
wi.Save();
}
else
{
ArrayList validationErrors = wi.Validate();
string errMessage = "Work item cannot be saved...";
foreach (Field field in validationErrors)
errMessage += "Field: " + field.Name + " has status: " + field.Status + "/n";
throw new ApplicationException(errMessage);
}
return wi;
}
开发者ID:rolandocc,项目名称:TFSAPIWrapper,代码行数:40,代码来源:TFSAPI.cs
示例6: ConfigureAsync
/// <inheritdoc/>
public async Task ConfigureAsync(TfsServiceProviderConfiguration configuration)
{
if (configuration == null)
{
throw new ArgumentNullException(nameof(configuration));
}
if(string.IsNullOrEmpty(configuration.WorkItemType))
{
throw new ArgumentNullException(nameof(configuration.WorkItemType));
}
this.logger.Debug("Configure of TfsSoapServiceProvider started...");
var networkCredential = new NetworkCredential(configuration.Username, configuration.Password);
var tfsClientCredentials = new TfsClientCredentials(new BasicAuthCredential(networkCredential)) { AllowInteractive = false };
var tfsProjectCollection = new TfsTeamProjectCollection(this.serviceUri, tfsClientCredentials);
this.workItemType = configuration.WorkItemType;
tfsProjectCollection.Authenticate();
tfsProjectCollection.EnsureAuthenticated();
this.logger.Debug("Authentication successful for {serviceUri}.", this.serviceUri.AbsoluteUri);
await Task.Run(
() =>
{
this.logger.Debug("Fetching workitem for id {parentWorkItemId}.", configuration.ParentWorkItemId);
this.workItemStore = new WorkItemStore(tfsProjectCollection);
this.parentWorkItem = this.workItemStore.GetWorkItem(configuration.ParentWorkItemId);
this.logger.Debug("Found parent work item '{title}'.", this.parentWorkItem.Title);
});
this.logger.Verbose("Tfs service provider configuration complete.");
}
开发者ID:acesiddhu,项目名称:supa,代码行数:32,代码来源:TfsSoapServiceProvider.cs
示例7: IsIncluded
public bool IsIncluded(WorkItem item)
{
if (ExcludedItemTypes.Any(x => x.Equals(item.Type.Name, StringComparison.InvariantCultureIgnoreCase)))
{
return false;
}
if (Projects.Any(x => x.ProjectName.Equals(item.Project.Name, StringComparison.InvariantCultureIgnoreCase)))
{
if (Projects.First(x => x.ProjectName.Equals(item.Project.Name, StringComparison.InvariantCultureIgnoreCase))
.ExcludedItemTypes.Any(x => x.Equals(item.Type.Name, StringComparison.InvariantCultureIgnoreCase)))
{
return false;
}
}
if (Whitelist)
{
return WhitelistedProjects.Any(x => x.Equals(item.Project.Name, StringComparison.InvariantCultureIgnoreCase)) &&
!BlacklistedProjects.Any(x => x.Equals(item.Project.Name, StringComparison.InvariantCultureIgnoreCase));
}
else
{
return !BlacklistedProjects.Any(x => x.Equals(item.Project.Name, StringComparison.InvariantCultureIgnoreCase));
}
}
开发者ID:DanMannMann,项目名称:Timekeeper,代码行数:26,代码来源:TimekeeperVsExtensionSettings.cs
示例8: Map
public static List<WorkItemField> Map(WorkItem workItem)
{
switch (workItem.Type.Name)
{
case Constants.TfsBug:
{
return GetMapping(workItem, BugFields);
}
case Constants.TfsTask:
{
return GetMapping(workItem, TaskFields);
}
case Constants.TfsUserStory:
{
return GetMapping(workItem, UserStoryFields);
}
case Constants.TfsIssue:
{
return GetMapping(workItem, IssueFields);
}
case Constants.TfsBacklogItem:
{
return GetMapping(workItem, BackLogFields);
}
case Constants.TfsImpediment:
{
return GetMapping(workItem, ImpedimentFields);
}
default:
throw new ArgumentException(string.Format("Invalid Work Item Type: {0}", workItem.Type.Name));
}
}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:32,代码来源:WorkItemsUsedFields.cs
示例9: GetReleaseNumber
private static string GetReleaseNumber(WorkItem workItem, string customReleaseNumberFieldName)
{
if (string.IsNullOrEmpty(customReleaseNumberFieldName))
return workItem.IterationPath.Substring(workItem.IterationPath.LastIndexOf('\\') + 1);
else
return workItem.Fields[customReleaseNumberFieldName].Value.ToString().Trim();
}
开发者ID:mwpnl,项目名称:bmx-tfs2012,代码行数:7,代码来源:Tfs2012Issue.cs
示例10: CopyAttributes
public bool CopyAttributes(Story pivotalstorySource, WorkItem destinationWorkItem)
{
destinationWorkItem.Fields[ConchangoTeamsystemScrumEstimatedeffort].Value = pivotalstorySource.Estimate;
destinationWorkItem.Fields[ConchangoTeamsystemScrumBusinesspriority].Value = pivotalstorySource.Priority;
destinationWorkItem.Fields[ConchangoTeamsystemScrumDeliveryorder].Value = pivotalstorySource.Priority;
return true;
}
开发者ID:ricred,项目名称:PivotalTFS,代码行数:7,代码来源:Conchango_Template.cs
示例11: ProcessWorkItemRelationships
/// <summary>
/// Method for processing work items down to the changesets that are related to them
/// </summary>
/// <param name="wi">Work Item to process</param>
/// <param name="outputFile">File to write the dgml to</param>
/// <param name="vcs">Version Control Server which contains the changesets</param>
public void ProcessWorkItemRelationships(WorkItem[] wi,
string outputFile,
bool hideReverse,
bool groupbyIteration,
bool dependencyAnalysis,
List<TempLinkType> selectedLinks,
VersionControlServer vcs)
{
string projectName = wi[0].Project.Name;
_workItemStubs = new List<WorkItemStub>();
_wis = wi[0].Store;
_vcs = vcs;
_tms = vcs.TeamProjectCollection.GetService<ITestManagementService>();
_tmp = _tms.GetTeamProject(projectName);
_selectedLinks = selectedLinks;
//Store options
_hideReverse = hideReverse;
_groupbyIteration = groupbyIteration;
_dependencyAnalysis = dependencyAnalysis;
for (int i = 0; i < wi.Length; i++)
{
ProcessWorkItemCS(wi[i]);
}
WriteChangesetInfo(outputFile, projectName);
}
开发者ID:amccool,项目名称:WorkItemVisualization,代码行数:35,代码来源:ProcessDGMLData.cs
示例12: AddWorkItem
public void AddWorkItem()
{
WorkItem newItem = new WorkItem( teamProject.WorkItemTypes["タスク"] );
newItem.Title = "作業項目の概要です";
newItem.Description = "作業項目の詳細です";
newItem.Save();
}
开发者ID:kaorun55,项目名称:tfs_sandbox,代码行数:7,代码来源:TfsClient.cs
示例13: WorkItemModel
public WorkItemModel(WorkItem workItem)
{
Title = workItem.Title;
ID = workItem.Id;
Type = workItem.Type.Name;
CompletedWork = Type == "Task" && workItem["Completed Work"] != null ? (double)workItem["Completed Work"] : 0;
}
开发者ID:campbell18,项目名称:TimeSheet,代码行数:7,代码来源:WorkItemModel.cs
示例14: FromWorkItem
/// <summary>
/// Fills this instance's fields using the values from the provided <see cref="WorkItem"/>.
/// This includes the Priority, Reason, Original Estimate, Remaining Work and Completed work fields.
/// </summary>
public override void FromWorkItem(WorkItem item)
{
base.FromWorkItem(item);
ResolvedBy = GetFieldValue(item, "Resolved By");
if (item.Fields.Contains("Priority") && item.Fields["Priority"].Value != null)
Priority = item.Fields["Priority"].Value.ToString().ToIntOrDefault();
if (item.Fields.Contains("Reason") && item.Fields["Reason"].Value != null)
Reason = item.Fields["Reason"].Value.ToString();
// Estimates
// Check this field exists. 4.2 Agile doesn't have this field
if (item.Fields.Contains("Original Estimate") && item.Fields["Original Estimate"].Value != null)
EstimatedHours = item.Fields["Original Estimate"].Value.ToString().ToDoubleOrDefault();
if (item.Fields.Contains("Remaining Work") && item.Fields["Remaining Work"].Value != null)
RemainingHours = item.Fields["Remaining Work"].Value.ToString().ToDoubleOrDefault();
if (item.Fields.Contains("Completed Work") && item.Fields["Completed Work"].Value != null)
CompletedHours = item.Fields["Completed Work"].Value.ToString().ToDoubleOrDefault();
// For updates only
if (item.Fields.Contains("Original Estimate") && item.Fields["Original Estimate"].Value != null)
EstimatedHours = item.Fields["Original Estimate"].Value.ToString().ToDoubleOrDefault();
}
开发者ID:yetanotherchris,项目名称:spruce,代码行数:31,代码来源:TaskSummary.cs
示例15: AddToTFVC
public bool AddToTFVC(string[] _files, WorkItem _wi, Workspace _ws)
{
try
{
_ws.Get();
// Now add everything.
_ws.PendAdd(_files, false);
WorkItemCheckinInfo[] _wici = new WorkItemCheckinInfo[1];
_wici[0] = new WorkItemCheckinInfo(_wi, WorkItemCheckinAction.Associate);
if (_ws.CheckIn(_ws.GetPendingChanges(), null, null, _wici, null) > 0)
{
_ws.Delete();
return true;
}
else
{
return false;
}
}
catch
{
return false;
}
}
开发者ID:hopenbr,项目名称:HopDev,代码行数:28,代码来源:TFVC.cs
示例16: GetAtivatedChildUsCount
private int GetAtivatedChildUsCount(WorkItemStore workItemStore, WorkItem wi)
{
var ids = new List<int>();
foreach (WorkItemLink item in wi.WorkItemLinks)
{
if (item.LinkTypeEnd.Name == "Child")
{
ids.Add(item.TargetId);
}
}
var query = string.Format("SELECT [System.Id],[System.WorkItemType],[System.Title] FROM WorkItems WHERE [System.TeamProject] = 'PSG Dashboard' AND [System.WorkItemType] = 'User Story' AND [System.State] = 'Active' AND [System.Id] In ({0})", GetFormatedIds(ids));
var workItems = workItemStore.Query(query);
var count = 0;
foreach (WorkItem tWi in workItems)
{
if (tWi.Type.Name == "User Story")
{
count++;
}
}
return count;
}
开发者ID:soft-nt,项目名称:TFSRoadmap,代码行数:27,代码来源:TfsRoadmapProvider.cs
示例17: AddLeadTaskRow
internal static int AddLeadTaskRow(
DataGridView dgv,
ViewFiltersBuilder viewFiltersBuilder,
WorkItemInfoFiller workItemInfoFiller,
ViewColumnsIndexes viewColumnsIndexes,
FreeDaysCalculator freeDaysCalculator,
FocusFactorCalculator focusFactorCalculator,
WorkItem leadTask,
DataContainer data,
Dictionary<int, string> planningAssignments)
{
dgv.Rows.Add(new DataGridViewRow());
var leadTaskRow = dgv.Rows[dgv.Rows.Count - 1];
List<int> blockersIds = data.BlockersDict.ContainsKey(leadTask.Id)
? data.BlockersDict[leadTask.Id]
: null;
bool shouldCheckEstimate = workItemInfoFiller.FillLeadTaskInfo(
viewFiltersBuilder,
leadTask,
leadTaskRow,
data,
blockersIds);
viewFiltersBuilder.MarkLeadTaskRow(leadTaskRow);
if (blockersIds != null)
foreach (int blockerId in blockersIds)
{
AddBlockerRow(
dgv,
viewFiltersBuilder,
workItemInfoFiller,
data,
planningAssignments,
blockerId);
}
if (leadTask.IsProposed())
return ScheduleFiller.AddDatesProposed(
viewColumnsIndexes,
freeDaysCalculator,
focusFactorCalculator,
leadTask,
leadTaskRow,
viewColumnsIndexes.FirstDateColumnIndex,
m_proposedLtMark,
m_proposedLtMark,
shouldCheckEstimate);
return ScheduleFiller.AddDatesActive(
viewColumnsIndexes,
freeDaysCalculator,
focusFactorCalculator,
leadTask,
leadTaskRow,
viewColumnsIndexes.FirstDateColumnIndex,
m_activeLtMark,
m_activeLtMark);
}
开发者ID:starkmsu,项目名称:TaskScheduler,代码行数:59,代码来源:RowsAdder.cs
示例18: WorkItemLinkInfoDetails
public WorkItemLinkInfoDetails(WorkItemLinkInfo linkInfo, WorkItem sourceWorkItem,
WorkItem targetWorkItem,WorkItemLinkType linkType)
{
this.LinkInfo = linkInfo;
this.SourceWorkItem = sourceWorkItem;
this.TargetWorkItem = targetWorkItem;
this.LinkType = linkType;
}
开发者ID:zealoussnow,项目名称:OneCode,代码行数:8,代码来源:WorkItemLinkInfoDetails.cs
示例19: WorkItemParser
public WorkItemParser(WorkItem workItem)
{
this.WorkItem = workItem;
DetailedList = new ObservableCollection<Item>();
loadCommonData(workItem);
}
开发者ID:xanthalas,项目名称:TfsCli,代码行数:8,代码来源:WorkItemParser.cs
示例20: GenerateManualTest
/// <summary>
/// Generates the manual test.
/// </summary>
/// <param name="targetDirectory">The target directory.</param>
/// <param name="workItem">The work item.</param>
public void GenerateManualTest(string targetDirectory, WorkItem workItem)
{
// Create Bob the stringBuilder :-)
StringBuilder _bob = new StringBuilder();
// Create the XML header
_bob.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
// Create the root element of the manual test
_bob.Append("<ManualTest xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2006\" id=\"");
_bob.Append(Guid.NewGuid().ToString());
_bob.Append("\" name=\"");
_bob.Append(workItem.Title);
_bob.AppendLine("\">");
_bob.AppendLine("");
// Add the work item ID
_bob.AppendLine("<Workitems>");
_bob.Append("<Workitem>");
_bob.Append(workItem.Id.ToString());
_bob.AppendLine("</Workitem>");
_bob.AppendLine("</Workitems>");
_bob.AppendLine("");
// Create the test body
_bob.AppendLine("<BodyText>");
_bob.Append("<![CDATA[");
// Replace all the TFS line feeds with ones that work in the text document
string alternateFieldName = ConfigurationManager.AppSettings["AlternateDescriptionFieldName"].ToString();
if (string.IsNullOrEmpty(alternateFieldName))
{
_bob.Append(workItem.Title + "\n\r\n\r\n\r\n\r");
_bob.Append(workItem.Description.Replace("\n","\n\r\n\r"));
}
else
{
string testDescription = workItem.Fields[alternateFieldName].Value.ToString();
// Strip out the html
testDescription = StripTags(testDescription);
testDescription = workItem.Title + "\n\n" + testDescription;
testDescription = testDescription.Replace("\n", "\n\r\n\r");
_bob.Append(testDescription);
}
_bob.AppendLine("]]>");
// Close out the document
_bob.AppendLine("</BodyText>");
_bob.AppendLine("</ManualTest>");
// Write out the document to disk
StreamWriter _streamWriter = new StreamWriter(targetDirectory + @"\" + workItem.Title + ".mtx", false);
_streamWriter.Write(_bob.ToString());
_streamWriter.Close();
}
开发者ID:teknologika,项目名称:stax,代码行数:63,代码来源:TFSWriter.cs
注:本文中的Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论