如何检查 TFS Workspace.Get 方法何时完成?
我使用 Microsoft.TeamFoundation.Client 命名空间中的 Workspace 类从 Team Foundation Server 获取特定分支的最新代码。
workspace.Get(new string[] { SelectedRelease.ServerPath }, VersionSpec.Latest,
RecursionType.Full, GetOptions.GetAll);
获得最新代码后,我以编程方式构建相关的解决方案。该代码可以在帖子此处< /a>.
我的问题是“如何知道 Workspace.Get 方法何时完成?”在下载完成之前我无法构建它。我想过监视解决方案文件夹,但我不知道文件的内置顺序。
I am using the Workspace
class from the Microsoft.TeamFoundation.Client
namespace to get the latest code for a particular branch from a Team Foundation Server.
workspace.Get(new string[] { SelectedRelease.ServerPath }, VersionSpec.Latest,
RecursionType.Full, GetOptions.GetAll);
After I get the latest code, I build the relevant solution programmatically. The code can be found in the post here.
My question is 'how can I find out when the Workspace.Get method is complete? I can't build it until it has finished downloading. I thought about monitoring the solution folder, but I don't know which order the files are built in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它不是异步的。一旦它返回,你的获取就完成了。
如果您想在另一个线程中侦听完成情况(并使用 TFS 的事件系统来执行此操作,而不是滚动您自己的事件系统),您可以将 GettingEventHandler 连接到 VersionControlClient。
It's not asynchronous. As soon as it returns, your get has finished.
If you want to listen for completion in another thread (and use TFS's event system to do so instead of rolling your own), you can hook up a GettingEventHandler to your VersionControlClient.
这个问题可能对您有用:
使用 TFS 2010 用于订阅工作区事件的 API
This question may be of use to you:
Using the TFS 2010 API to subscribe to Workspace Events