예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Issue"/> class.
        /// </summary>
        /// <param name="issueData">
        /// Issue data from Webservice proxy.
        /// </param>
        internal Issue(MantisConnectWebservice.IssueData issueData)
        {
            this.Id                    = Convert.ToInt32(issueData.id);
            this.Project               = new ObjectRef(issueData.project);
            this.Category              = new ObjectRef(issueData.category);
            this.Summary               = issueData.summary;
            this.Description           = StringUtils.WebserviceMultilineToNative(issueData.description);
            this.StepsToReproduce      = issueData.steps_to_reproduce == null ? String.Empty : StringUtils.WebserviceMultilineToNative(issueData.steps_to_reproduce);
            this.AdditionalInformation = issueData.additional_information == null ? String.Empty : StringUtils.WebserviceMultilineToNative(issueData.additional_information);
            this.AssignedTo            = issueData.handler == null ? null : new User(issueData.handler);
            this.ReportedBy            = new User(issueData.reporter);
            this.ProductVersion        = issueData.version == null ? String.Empty : issueData.version;
            this.ProductBuild          = issueData.build == null ? String.Empty : issueData.build;
            this.Os                    = issueData.os == null ? String.Empty : issueData.os;
            this.OsBuild               = issueData.os_build == null ? String.Empty : issueData.os_build;
            this.Platform              = issueData.platform == null ? String.Empty : issueData.platform;
            this.FixedInVersion        = issueData.fixed_in_version == null ? String.Empty : issueData.fixed_in_version;
            this.SponsorshipTotal      = Convert.ToInt32(issueData.sponsorship_total);
            this.Reproducibility       = new ObjectRef(issueData.reproducibility);
            this.Resolution            = new ObjectRef(issueData.resolution);
            this.Eta                   = new ObjectRef(issueData.eta);
            this.Status                = new ObjectRef(issueData.status);
            this.Priority              = new ObjectRef(issueData.priority);
            this.Severity              = new ObjectRef(issueData.severity);
            this.Projection            = new ObjectRef(issueData.projection);
            this.ViewState             = new ObjectRef(issueData.view_state);

            this.Notes         = IssueNote.ConvertArray(issueData.notes);
            this.Attachments   = Attachment.ConvertArray(issueData.attachments);
            this.Relationships = IssueRelationship.ConvertArray(issueData.relationships);
        }