Beispiel #1
0
 internal static void Open(List <ExtendedItem> items, Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace)
 {
     using (var dialog = new UndoDialog())
     {
         dialog.FillStore(items, workspace);
         if (dialog.Run(Toolkit.CurrentEngine.WrapWindow(MessageService.RootWindow)) == Command.Ok)
         {
             var changesToUndo = dialog.SelectedItems;
             using (var progress = VersionControlService.GetProgressMonitor("Undo", VersionControlOperationType.Pull))
             {
                 progress.BeginTask("Undo", changesToUndo.Count);
                 var itemSpecs = new List <ItemSpec>();
                 foreach (var change in changesToUndo)
                 {
                     itemSpecs.Add(new ItemSpec(change.LocalItem, change.ItemType == ItemType.File ? RecursionType.None : RecursionType.Full));
                 }
                 workspace.Undo(itemSpecs, progress);
                 progress.EndTask();
                 progress.ReportSuccess("Finish Undo");
             }
         }
     }
 }