public BugzillaBug(bug bug) : this()
        {
            bug_id       = bug.bug_id;
            reporter     = bug.reporter;
            assigned_to  = bug.assigned_to;
            priority     = bug.priority;
            bug_severity = bug.bug_severity;
            bug_status   = bug.bug_status;

            op_sys         = bug.op_sys;
            component      = bug.component;
            version        = bug.version;
            classification = bug.classification;
            rep_platform   = bug.rep_platform;
            customFields   = bug.custom_fieldCollection.Cast <custom_field>().ToList();

            var longDescCollection = GetDescriptionCollection(bug);

            if (longDescCollection.Count > 0)
            {
                description = longDescCollection[0].thetext;
            }
            if (longDescCollection.Count > 1)
            {
                comments = longDescCollection
                           .Cast <long_desc>()
                           .Skip(1)
                           .Select(x => new BugzillaComment(x))
                           .ToList();
            }

            creation_ts          = bug.creation_ts;
            short_desc           = DescriptionConverter.CleanUpContent(bug.short_desc);
            attachmentCollection = CreateAttachments(bug.attachmentCollection.Cast <attachment>());
        }
Exemplo n.º 2
0
        public T Parse(string content)
        {
            TextReader reader         = new StringReader(DescriptionConverter.CleanUpContent(content));
            var        serializer     = new XmlSerializer(typeof(T));
            var        bugzillaObject = (T)serializer.Deserialize(reader);

            return(bugzillaObject);
        }
        private static long_descCollection GetDescriptionCollection(bug bug)
        {
            foreach (long_desc description in bug.long_descCollection)
            {
                description.thetext = DescriptionConverter.CleanUpContent(description.thetext);
            }

            return(bug.long_descCollection);
        }
Exemplo n.º 4
0
        public T Parse(Stream stream)
        {
            var        serializer = new XmlSerializer(typeof(T));
            TextReader reader     = new StreamReader(stream);

            var content = DescriptionConverter.CleanUpContent(reader.ReadToEnd());

            var bugzillaObject = (T)serializer.Deserialize(new StringReader(content));

            return(bugzillaObject);
        }
Exemplo n.º 5
0
        private void CreateComment(int?tpBugId, BugzillaComment bugzillaComment)
        {
            if (string.IsNullOrEmpty(bugzillaComment.Body))
            {
                return;
            }

            var userId = ObjectFactory.GetInstance <IUserMapper>().GetTpIdBy(bugzillaComment.Author);

            var comment = new CommentDTO
            {
                Description = DescriptionConverter.FormatDescription(bugzillaComment.Body),
                GeneralID   = tpBugId,
                CreateDate  = CreateDateConverter.ParseFromBugzillaLocalTime(bugzillaComment.DateAdded),
                OwnerID     = userId
            };

            Send(new CreateCommentCommand(comment));
            Data.CommentsToCreateCount++;
        }