本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.DeleteWorkspace方法的典型用法代码示例。如果您正苦于以下问题:C# VersionControlServer.DeleteWorkspace方法的具体用法?C# VersionControlServer.DeleteWorkspace怎么用?C# VersionControlServer.DeleteWorkspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer
的用法示例。
在下文中一共展示了VersionControlServer.DeleteWorkspace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLatestVerstion
private string GetLatestVerstion(VersionControlServer versionControl, TfsGetCodeParams objTfsGetCodeParams)
{
Workspace[] workspaces = versionControl.QueryWorkspaces(objTfsGetCodeParams.WorkStationName, versionControl.AuthenticatedUser, Workstation.Current.Name);
if (workspaces.Length > 0)
{
versionControl.DeleteWorkspace(objTfsGetCodeParams.WorkStationName, versionControl.AuthenticatedUser);
}
Workspace workspace = versionControl.CreateWorkspace(objTfsGetCodeParams.WorkStationName, versionControl.AuthenticatedUser, "Temporary Workspace");
try
{
workspace.Map(objTfsGetCodeParams.SourcePath, objTfsGetCodeParams.TargetPath+"/"+objTfsGetCodeParams.BuildVersion );
GetRequest request = new GetRequest(new ItemSpec(objTfsGetCodeParams.SourcePath, RecursionType.Full), VersionSpec.Latest);
GetStatus status = workspace.Get(request, GetOptions.GetAll | GetOptions.Overwrite); // this line doesn't do anything - no failures or errors
return "done";
}
finally
{
if (workspace != null)
{
workspace.Delete();
}
}
}
示例2: RemoveWorkspace
private static void RemoveWorkspace(string workspaceName, VersionControlServer server)
{
TraceHelper.TraceInformation(TraceSwitches.TfsDeployer, "Removing Workspace{0}", workspaceName);
if (server.QueryWorkspaces(workspaceName, server.AuthenticatedUser, Environment.MachineName).Length > 0)
{
server.DeleteWorkspace(workspaceName, server.AuthenticatedUser);
}
}
示例3: SetupWorkspace
private void SetupWorkspace(string workingDirectory, string cpSourceBranch, VersionControlServer versionControl)
{
List<WorkingFolder> workingFolders = new List<WorkingFolder>();
workingFolders.Add(new WorkingFolder(cpSourceBranch, workingDirectory));
// Create a workspace.
Workspace[] workspaces = versionControl.QueryWorkspaces(sourcePuller.WorkspaceName, versionControl.AuthorizedUser, Environment.MachineName);
if (workspaces.Length > 0)
versionControl.DeleteWorkspace(sourcePuller.WorkspaceName, versionControl.AuthorizedUser);
workspace = versionControl.CreateWorkspace(sourcePuller.WorkspaceName, versionControl.AuthorizedUser, "Work for GetTFSSourceUtil tool", workingFolders.ToArray(), Environment.MachineName);
}