Example #1
0
        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);
                });
            }
        }
Example #2
0
 void TrackWorkItem(object o)
 {
     try
     {
         TfsWorkItemWrapper wrap = (TfsWorkItemWrapper)o;
         Repository.Instance.TfsUIInteractionProvider.TrackWorkItem(wrap.TfsWorkItem.Id);
     }
     catch (Exception)
     {
     }
 }
Example #3
0
        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;
            }
        }
Example #4
0
        /// <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);
        }
Example #5
0
 public WorkItemHasBeenMergedEventArgs(TfsWorkItemWrapper workItem)
 {
     WorkItem = workItem;
 }