Ejemplo n.º 1
0
        public TfsProject(string serverUri, string project)
        {
            this.serverUri    = serverUri;
            tfs               = null;
            this.project      = project;
            supportsHtml      = false;
            failedAttachments = false;
            importSummary     = new ImportSummary();

            if (string.IsNullOrWhiteSpace(serverUri) == false)
            {
                tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(serverUri));
            }

            fields   = TfsFieldFactory.GetFieldsFor(tfs, project);
            tfsUsers = new TfsUsers(this);

            if (tfs != null)
            {
                var workItemStore = tfs.GetService <WorkItemStore>();

                TfsField descriptionField = fields["Description"];
                if (descriptionField != null)
                {
                    supportsHtml = descriptionField.SupportsHtml;
                }
                tfsUsers.OnFailedToImpersonate += OnWarn;

                areaPaths = new List <string> {
                    this.project
                };
                foreach (Node area in workItemStore.Projects[this.project].AreaRootNodes)
                {
                    areaPaths.Add(area.Path);
                    foreach (Node item in area.ChildNodes)
                    {
                        areaPaths.Add(item.Path);
                    }
                }

                processTemplateName = getProcessTemplateName(this.project);
            }
        }
Ejemplo n.º 2
0
        public TfsProject(string serverUri, string project)
        {
            this.serverUri = serverUri;
            tfs = null;
            this.project = project;
            supportsHtml = false;
            failedAttachments = false;
            importSummary = new ImportSummary();

            if (string.IsNullOrWhiteSpace(serverUri) == false)
            {
                tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(serverUri));
            }

            fields = TfsFieldFactory.GetFieldsFor(tfs, project);
            tfsUsers = new TfsUsers(this);

            if (tfs != null)
            {
                var workItemStore = tfs.GetService<WorkItemStore>();

                TfsField descriptionField = fields["Description"];
                if (descriptionField != null)
                {
                    supportsHtml = descriptionField.SupportsHtml;
                }
                tfsUsers.OnFailedToImpersonate += OnWarn;

                areaPaths = new List<string> { this.project };
                foreach (Node area in workItemStore.Projects[this.project].AreaRootNodes)
                {
                    areaPaths.Add(area.Path);
                    foreach (Node item in area.ChildNodes)
                    {
                        areaPaths.Add(item.Path);
                    }
                }

                processTemplateName = getProcessTemplateName(this.project);
            }
        }