public void CreateProjectCollection(string name, string description, eSharePointActions sharePointAction = eSharePointActions.None, string sharePointServerHash = null, string sharePointSitePath = null, eReportingActions reportingAction = eReportingActions.None, string reportServerHash = null, string reportFolderPath = null)
        {
            if (!this.CollectionExists(name))
            {
                var servicingTokens = new Dictionary<string, string>();
                if (sharePointAction != eSharePointActions.None)
                {
                    servicingTokens.Add("SharePointAction", sharePointAction.ToString());
                    servicingTokens.Add("SharePointServer", sharePointServerHash);
                    servicingTokens.Add("SharePointSitePath", (sharePointSitePath ?? string.Empty).Replace("~/", name + "/"));
                }
                else
                {
                    servicingTokens.Add("SharePointAction", "None");
                }

                if (reportingAction != eReportingActions.None)
                {
                    servicingTokens.Add("ReportingAction", reportingAction.ToString());
                    servicingTokens.Add("ReportServer", reportServerHash);
                    servicingTokens.Add("ReportFolder", (reportFolderPath ?? string.Empty).Replace("~/", name + "/"));
                }
                else
                {
                    servicingTokens.Add("ReportingAction", "None");
                }

                ServicingJobDetail sjd = this._teamProjectCollectionService.QueueCreateCollection(name, description, false, "~/" + name + "/", TeamFoundationServiceHostStatus.Started, servicingTokens);

                this._teamProjectCollectionService.WaitForCollectionServicingToComplete(sjd);
            }
            else
            {
                throw new Exception("The collection " + name + " already exists in Team Foundation Server.");
            }
        }
示例#2
0
        public void CreateProjectCollection(string name, string description, eSharePointActions sharePointAction = eSharePointActions.None, string sharePointServerHash = null, string sharePointSitePath = null, eReportingActions reportingAction = eReportingActions.None, string reportServerHash = null, string reportFolderPath = null)
        {
            if (!this.CollectionExists(name))
            {
                var servicingTokens = new Dictionary <string, string>();
                if (sharePointAction != eSharePointActions.None)
                {
                    servicingTokens.Add("SharePointAction", sharePointAction.ToString());
                    servicingTokens.Add("SharePointServer", sharePointServerHash);
                    servicingTokens.Add("SharePointSitePath", (sharePointSitePath ?? string.Empty).Replace("~/", name + "/"));
                }
                else
                {
                    servicingTokens.Add("SharePointAction", "None");
                }

                if (reportingAction != eReportingActions.None)
                {
                    servicingTokens.Add("ReportingAction", reportingAction.ToString());
                    servicingTokens.Add("ReportServer", reportServerHash);
                    servicingTokens.Add("ReportFolder", (reportFolderPath ?? string.Empty).Replace("~/", name + "/"));
                }
                else
                {
                    servicingTokens.Add("ReportingAction", "None");
                }

                ServicingJobDetail sjd = this._teamProjectCollectionService.QueueCreateCollection(name, description, false, "~/" + name + "/", TeamFoundationServiceHostStatus.Started, servicingTokens);

                this._teamProjectCollectionService.WaitForCollectionServicingToComplete(sjd);
            }
            else
            {
                throw new Exception("The collection " + name + " already exists in Team Foundation Server.");
            }
        }