コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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;
        }