void SelectMarkedItems() { TfsWorkItemWrapper firstItem = null; try { SuppressNotifications(); foreach (var item in WorkItems) { if (item.IsHighlighted) { if (firstItem == null) { firstItem = item; } item.IsSelected = true; } } } finally { AllowNotifications(); } if (!_workItemHighlightUpdatePending) { _workItemHighlightUpdatePending = true; Repository.Instance.BackgroundTaskManager.Post( () => { HighlightChangesets(firstItem); return(true); }); } }
void TrackWorkItem(object o) { try { TfsWorkItemWrapper wrap = (TfsWorkItemWrapper)o; Repository.Instance.TfsUIInteractionProvider.TrackWorkItem(wrap.TfsWorkItem.Id); } catch (Exception) { } }
private void HighlightChangesets(TfsWorkItemWrapper sender) { _workItemHighlightUpdatePending = false; if (!Repository.Instance.BackgroundTaskManager.RunWithCancelDialog( (trackProgressParameters) => TfsItemCache.HighlightChangesets(trackProgressParameters), "Please wait while the changeset view is being updated ...")) { sender.IsSelected = false; } }
/// <summary> /// Checks if a specific element is already in the cache; if so, it updates /// the cache (if necessary). /// It returns the cached element in any case. /// Purpose: avoids reading the elements' properties more than once /// (since they involve a round-trip to the TFS server) /// </summary> /// <param name="workItem">The work item check</param> /// <returns>The work item from the cache</returns> public TfsWorkItemWrapper UpdateWorkItemFromCache(TfsWorkItemWrapper workItem) { TfsWorkItemWrapper fromCache = null; lock (_workItemCacheLock) { if (_workItemCacheMap.TryGetValue(workItem.TfsWorkItem.Id, out fromCache)) { if (fromCache.TfsWorkItem.ChangedDate < workItem.TfsWorkItem.ChangedDate) { fromCache.TfsWorkItem = workItem.TfsWorkItem; return(fromCache); } else { return(fromCache); } } _workItemCache.Add(workItem); _workItemCacheMap[workItem.TfsWorkItem.Id] = workItem; } return(workItem); }
public WorkItemHasBeenMergedEventArgs(TfsWorkItemWrapper workItem) { WorkItem = workItem; }