Exemple #1
0
        public static void Disconnect()
        {
            if (!string.IsNullOrEmpty(temporaryWorkspaceName))
            {
                try
                {
                    Workspace     workspace       = controlServer.GetWorkspace(temporaryWorkspaceName, ControlServer.AuthenticatedUser);
                    List <string> foldersToDelete = new List <string>();
                    foreach (var workingFolder in workspace.Folders)
                    {
                        foldersToDelete.Add(workingFolder.LocalItem);
                    }

                    controlServer.DeleteWorkspace(temporaryWorkspaceName, controlServer.AuthenticatedUser);
                    temporaryWorkspaceName = null;

                    foreach (var folder in foldersToDelete)
                    {
                        try
                        {
                            Util.RecursiveFolderDelete(folder);
                        }
                        catch {}
                    }
                }
                catch { }
            }

            if (tfsServer != null)
            {
                BuildServerEvents.Instance.DisconnectAll();

                tfsServer.Dispose();
            }
        }
 public void Dispose()
 {
     if (_tfs != null)
     {
         _tfs.Dispose();
     }
 }
Exemple #3
0
 public void Dispose()
 {
     _buildServer = null;
     if (_tfServer != null)
     {
         _tfServer.Dispose();
     }
     _buildDefinition = null;
     GC.Collect();
 }