2012-02-18 58 views
0

我想要查看一個teamproject從最後幾小時,一天,一週,一個或多個入住的列表。 ...這可能通過TFS SDK(編程方式!!)?我怎樣才能做到這一點?從過去的幾個小時/天/周獲得所有入住登記

從這些信息中,我想根據例如最後一天的簽入次數來進行項目活動等統計。

謝謝!

回答

1

我自己找到了解決方案。也許有人可以使用它:

TfsTeamProjectCollection tfsTeamCol = new TfsTeamProjectCollection(new Uri(serverURL)); 
     VersionControlServer vcs = tfsTeamCol.GetService<VersionControlServer>(); 

     var history = vcs.QueryHistory("$/*", // The local path to an item for which history will be queried. This parameter can include wildcards 
             VersionSpec.Latest, //Search latest version 
             0, //No unique deletion id 
             RecursionType.Full, //Full recursion on the path 
             null, //All users 
             new DateVersionSpec(DateTime.Now - TimeSpan.FromDays(7)), //From the 7 days ago ... 
             LatestVersionSpec.Instance, //To the current version ... 
             Int32.MaxValue, //Include all changes. Can limit the number you get back. 
             false, //Don't include details of items, only metadata. 
             false //Slot mode is false. 
             ); 

int changesetCounter = 0; 
     foreach (Changeset changeset in history) 
     { 
      changesetCounter++; 
     //... 
     } 

如果有一個更好的解決方案,請讓我知道!

相關問題