private void GetLatestForAllWorkspaces(CodeRepositoryItem codeRepositoryItem)
 {
     var workspaceResults = this.workspaceQueryService.RetrieveAll();
     foreach (var workspaceResult in workspaceResults)
     {
         var getLatestCommand = this.commandFactory.Create(TfsCommandType.GetLatest, workspaceResult.MappedPaths.First());
         var getLatestResult = getLatestCommand.Run();
     }
 }
        public void GetLatest(CodeRepositoryItem codeRepositoryItem)
        {
            var repositoryType = codeRepositoryItem.ParseAs<TFSHandledType>("TFS");
            if (!repositoryType.HasValue)
            {
                throw new NotSupportedException(string.Format("Repository type {0} not supported by GetLatest", codeRepositoryItem.Type));
            }

            switch (repositoryType.Value)
            {
                case TFSHandledType.AllWorkspaces:
                    this.GetLatestForAllWorkspaces(codeRepositoryItem);
                    break;
                case TFSHandledType.Workspace:
                    throw new NotImplementedException(string.Format("Repository type {0} has not been implemented for GetLatest yet", repositoryType.Value));
                case TFSHandledType.Folder:
                    throw new NotImplementedException(string.Format("Repository type {0} has not been implemented for GetLatest yet", repositoryType.Value));
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
        public string QueryStatus(CodeRepositoryItem codeRepositoryItem)
        {
            TFSHandledType? typeToHandle = codeRepositoryItem.ParseAs<TFSHandledType>("TFS");
            if (!typeToHandle.HasValue)
            {
                return "Not Supported";
            }

            string result = "Not Implemented";
            switch (typeToHandle.Value)
            {
                case TFSHandledType.AllWorkspaces:
                    result = this.QueryAllWorkspaces();
                    break;
                case TFSHandledType.Workspace:
                    result = this.QueryWorkspace(codeRepositoryItem);
                    break;
                case TFSHandledType.Folder:
                    result = this.QueryFolder(codeRepositoryItem);
                    break;
            }

            return result;
        }
 private string QueryWorkspace(CodeRepositoryItem codeRepositoryItem)
 {
     throw new NotImplementedException();
 }
 private string QueryFolder(CodeRepositoryItem codeRepositoryItem)
 {
     throw new NotImplementedException();
 }
 public bool CanHandle(CodeRepositoryItem codeRepositoryItem)
 {
     return codeRepositoryItem.CanBeHandledBy<TFSHandledType>("TFS");
 }