Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.ASSIGNED_TO: AssignTo = new IdentifiableName(reader); break;

                case RedmineKeys.NAME: Name = reader.ReadAsString(); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.AUTHOR: Author = new IdentifiableName(reader); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadAsDateTime(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadAsString(); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.SUMMARY: Summary = reader.ReadAsString(); break;

                case RedmineKeys.TITLE: Title = reader.ReadAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Generates an object from its XML representation.
        /// </summary>
        /// <param name="reader">The <see cref="T:System.Xml.XmlReader"/> stream from which the object is deserialized.</param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "name": Name = reader.ReadElementContentAsString(); break;

                case "identifier": Identifier = reader.ReadElementContentAsString(); break;

                case "description": Description = reader.ReadElementContentAsString(); break;

                case "parent": Parent = new IdentifiableName(reader); break;

                case "homepage": HomePage = reader.ReadElementContentAsString(); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "updated_on": UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "trackers": Trackers = reader.ReadElementContentAsCollection <ProjectTracker>(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #4
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "project": Project = new IdentifiableName(reader); break;

                case "author": Author = new IdentifiableName(reader); break;

                case "title": Title = reader.ReadElementContentAsString(); break;

                case "summary": Summary = reader.ReadElementContentAsString(); break;

                case "description": Description = reader.ReadElementContentAsString(); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.NAME: Name = reader.ReadAsString(); break;

                case RedmineKeys.DEFAULT_STATUS: DefaultStatus = new IdentifiableName(reader); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #6
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.ASSIGNED_TO: AsignTo = new IdentifiableName(reader); break;

                case RedmineKeys.NAME: Name = reader.ReadElementContentAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #7
0
        /// <inheritdoc />
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID:
                    Id = reader.ReadAsInt32().GetValueOrDefault();
                    break;

                case RedmineKeys.AUTHOR: Author = new IdentifiableName(reader); break;

                case RedmineKeys.CONTENT: Content = reader.ReadAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "issue_id": Issue = new IdentifiableName(reader); break;

                case "project_id": Project = new IdentifiableName(reader); break;

                case "spent_on": SpentOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "user": User = new IdentifiableName(reader); break;

                case "hours": Hours = reader.ReadElementContentAsDecimal(); break;

                case "activity_id": Activity = new IdentifiableName(reader); break;

                case "comments": Comments = reader.ReadElementContentAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.SUBJECT: Subject = reader.ReadAsString(); break;

                case RedmineKeys.TRACKER: Tracker = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadAsDateTime(); break;

                case RedmineKeys.DETAILS: Details = reader.ReadAsCollection <Detail>(); break;

                case RedmineKeys.NOTES: Notes = reader.ReadAsString(); break;

                case RedmineKeys.PRIVATE_NOTES: PrivateNotes = reader.ReadAsBool(); break;

                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #11
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "filename": FileName = reader.ReadElementContentAsString(); break;

                case "filesize": FileSize = reader.ReadElementContentAsInt(); break;

                case "content_type": ContentType = reader.ReadElementContentAsString(); break;

                case "author": Author = new IdentifiableName(reader); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "description": Description = reader.ReadElementContentAsString(); break;

                case "content_url": ContentUrl = reader.ReadElementContentAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #12
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "title": Title = reader.ReadElementContentAsString(); break;

                case "text": Text = reader.ReadElementContentAsString(); break;

                case "comments": Comments = reader.ReadElementContentAsString(); break;

                case "version": Version = reader.ReadElementContentAsInt(); break;

                case "author": Author = new IdentifiableName(reader); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "updated_on": UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "attachments": Attachments = reader.ReadElementContentAsCollection <Attachment>(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.CUSTOM_FIELDS: CustomFields = reader.ReadElementContentAsCollection <IssueCustomField>(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadElementContentAsString(); break;

                case RedmineKeys.DUE_DATE: DueDate = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.NAME: Name = reader.ReadElementContentAsString(); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.SHARING: Sharing = (VersionSharing)Enum.Parse(typeof(VersionSharing), reader.ReadElementContentAsString(), true); break;

                case RedmineKeys.STATUS: Status = (VersionStatus)Enum.Parse(typeof(VersionStatus), reader.ReadElementContentAsString(), true); break;

                case RedmineKeys.UPDATED_ON: UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.COMMENTS: Comments = reader.ReadAsString(); break;

                case RedmineKeys.COMMITTED_ON: CommittedOn = reader.ReadAsDateTime(); break;

                case RedmineKeys.REVISION: Revision = reader.ReadAsInt(); break;

                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #15
0
        public void ReadXml(XmlReader reader)
        {
            Id = Convert.ToInt32(reader.GetAttribute("id"));
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }
                switch (reader.Name)
                {
                case "tracker":
                    Tracker = new IdentifiableName(reader);
                    break;

                case "subject":
                    Subject = reader.ReadElementContentAsString();
                    break;

                default:
                    reader.Read();
                    break;
                }
            }
        }
Пример #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(XmlReader reader)
        {
            Id = reader.ReadAttributeAsInt(RedmineKeys.ID);
            reader.Read();

            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                case RedmineKeys.NOTES: Notes = reader.ReadElementContentAsString(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.DETAILS: Details = reader.ReadElementContentAsCollection <Detail>(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #17
0
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "id": Id = reader.ReadElementContentAsInt(); break;

                case "name": Name = reader.ReadElementContentAsString(); break;

                case "project": Project = new IdentifiableName(reader); break;

                case "description": Description = reader.ReadElementContentAsString(); break;

                case "status": Status = (VersionStatus)Enum.Parse(typeof(VersionStatus), reader.ReadElementContentAsString(), true); break;

                case "due_date": DueDate = reader.ReadElementContentAsNullableDateTime(); break;

                case "sharing": Sharing = (VersionSharing)Enum.Parse(typeof(VersionSharing), reader.ReadElementContentAsString(), true); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "updated_on": UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #18
0
        /// <summary>
        /// Generates an object from its XML representation.
        /// </summary>
        /// <param name="reader">The <see cref="System.Xml.XmlReader"/> stream from which the object is deserialized.</param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.NAME: Name = reader.ReadElementContentAsString(); break;

                case RedmineKeys.DEFAULT_STATUS: DefaultStatus = new IdentifiableName(reader); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadElementContentAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.AUTHOR: Author = new IdentifiableName(reader); break;

                case RedmineKeys.TITLE: Title = reader.ReadElementContentAsString(); break;

                case RedmineKeys.SUMMARY: Summary = reader.ReadElementContentAsString(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadElementContentAsString(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #20
0
        public void ReadXml(XmlReader reader)
        {
            Id = reader.ReadAttributeAsInt("id");
            reader.Read();

            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case "user": User = new IdentifiableName(reader); break;

                case "notes": Notes = reader.ReadElementContentAsString(); break;

                case "created_on": CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case "details": Details = reader.ReadElementContentAsCollection <Detail>(); break;

                default: reader.Read(); break;
                }
            }
        }
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }
                switch (reader.Name)
                {
                case "id":
                    Id = reader.ReadElementContentAsInt();
                    break;

                case "project":
                    Project = new IdentifiableName(reader);
                    break;

                case "assigned_to":
                    AsignTo = new IdentifiableName(reader);
                    break;

                case "name":
                    Name = reader.ReadElementContentAsString();
                    break;

                default:
                    reader.Read();
                    break;
                }
            }
        }
Пример #22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.FILENAME: FileName = reader.ReadElementContentAsString(); break;

                case RedmineKeys.FILESIZE: FileSize = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.CONTENT_TYPE: ContentType = reader.ReadElementContentAsString(); break;

                case RedmineKeys.AUTHOR: Author = new IdentifiableName(reader); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadElementContentAsString(); break;

                case RedmineKeys.CONTENT_URL: ContentUrl = reader.ReadElementContentAsString(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #23
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }
                switch (reader.Name)
                {
                case "id":
                    Id = reader.ReadElementContentAsInt();
                    break;

                case "project":
                    Project = new IdentifiableName(reader);
                    break;

                case "roles":
                    Roles = reader.ReadElementContentAsCollection <MembershipRole>();
                    break;

                default:
                    reader.Read();
                    break;
                }
            }
        }
Пример #24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.ATTACHMENTS: Attachments = reader.ReadElementContentAsCollection <Attachment>(); break;

                case RedmineKeys.AUTHOR: Author = new IdentifiableName(reader); break;

                case RedmineKeys.COMMENTS: Comments = reader.ReadElementContentAsString(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.TEXT: Text = reader.ReadElementContentAsString(); break;

                case RedmineKeys.TITLE: Title = reader.ReadElementContentAsString(); break;

                case RedmineKeys.UPDATED_ON: UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.VERSION: Version = reader.ReadElementContentAsInt(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.GROUP: Group = new IdentifiableName(reader); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.ROLES: Roles = reader.ReadElementContentAsCollection <MembershipRole>(); break;

                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.GROUP: Group = new IdentifiableName(reader); break;

                case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;

                case RedmineKeys.ROLES: Roles = reader.ReadAsCollection <MembershipRole>(); break;

                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #27
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }
                Revision = reader.ReadAttributeAsInt("revision");
                switch (reader.Name)
                {
                case "user":
                    User = new IdentifiableName(reader);
                    break;

                case "comments":
                    Comments = reader.ReadElementContentAsString();
                    break;

                case "committed_on":
                    CommittedOn = reader.ReadElementContentAsNullableDateTime();
                    break;

                default:
                    reader.Read();
                    break;
                }
            }
        }
Пример #28
0
        public void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                Revision = reader.ReadAttributeAsInt(RedmineKeys.REVISION);

                switch (reader.Name)
                {
                case RedmineKeys.USER: User = new IdentifiableName(reader); break;

                case RedmineKeys.COMMENTS: Comments = reader.ReadElementContentAsString(); break;

                case RedmineKeys.COMMITTED_ON: CommittedOn = reader.ReadElementContentAsNullableDateTime(); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                case RedmineKeys.ID: Id = reader.ReadAsInt(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadAsDateTime(); break;

                case RedmineKeys.CUSTOM_FIELDS: CustomFields = reader.ReadAsCollection <IssueCustomField>(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadAsString(); break;

                case RedmineKeys.ENABLED_MODULES: EnabledModules = reader.ReadAsCollection <ProjectEnabledModule>(); break;

                case RedmineKeys.HOMEPAGE: HomePage = reader.ReadAsString(); break;

                case RedmineKeys.IDENTIFIER: Identifier = reader.ReadAsString(); break;

                case RedmineKeys.INHERIT_MEMBERS: InheritMembers = reader.ReadAsBool(); break;

                case RedmineKeys.IS_PUBLIC: IsPublic = reader.ReadAsBool(); break;

                case RedmineKeys.ISSUE_CATEGORIES: IssueCategories = reader.ReadAsCollection <ProjectIssueCategory>(); break;

                case RedmineKeys.NAME: Name = reader.ReadAsString(); break;

                case RedmineKeys.PARENT: Parent = new IdentifiableName(reader); break;

                case RedmineKeys.STATUS: Status = (ProjectStatus)reader.ReadAsInt(); break;

                case RedmineKeys.TIME_ENTRY_ACTIVITIES: TimeEntryActivities = reader.ReadAsCollection <ProjectTimeEntryActivity>(); break;

                case RedmineKeys.TRACKERS: Trackers = reader.ReadAsCollection <ProjectTracker>(); break;

                case RedmineKeys.UPDATED_ON: UpdatedOn = reader.ReadAsDateTime(); break;

                case RedmineKeys.DEFAULT_ASSIGNEE: DefaultAssignee = new IdentifiableName(reader); break;

                case RedmineKeys.DEFAULT_VERSION: DefaultVersion = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }
Пример #30
0
        /// <summary>
        /// Generates an object from its XML representation.
        /// </summary>
        /// <param name="reader">The <see cref="System.Xml.XmlReader"/> stream from which the object is deserialized.</param>
        public override void ReadXml(XmlReader reader)
        {
            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                case RedmineKeys.ID: Id = reader.ReadElementContentAsInt(); break;

                case RedmineKeys.CREATED_ON: CreatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.CUSTOM_FIELDS: CustomFields = reader.ReadElementContentAsCollection <IssueCustomField>(); break;

                case RedmineKeys.DESCRIPTION: Description = reader.ReadElementContentAsString(); break;

                case RedmineKeys.ENABLED_MODULES: EnabledModules = reader.ReadElementContentAsCollection <ProjectEnabledModule>(); break;

                case RedmineKeys.HOMEPAGE: HomePage = reader.ReadElementContentAsString(); break;

                case RedmineKeys.IDENTIFIER: Identifier = reader.ReadElementContentAsString(); break;

                case RedmineKeys.INHERIT_MEMBERS: InheritMembers = reader.ReadElementContentAsBoolean(); break;

                case RedmineKeys.IS_PUBLIC: IsPublic = reader.ReadElementContentAsBoolean(); break;

                case RedmineKeys.ISSUE_CATEGORIES: IssueCategories = reader.ReadElementContentAsCollection <ProjectIssueCategory>(); break;

                case RedmineKeys.NAME: Name = reader.ReadElementContentAsString(); break;

                case RedmineKeys.PARENT: Parent = new IdentifiableName(reader); break;

                case RedmineKeys.STATUS: Status = (ProjectStatus)reader.ReadElementContentAsInt(); break;

                case RedmineKeys.TIME_ENTRY_ACTIVITIES: TimeEntryActivities = reader.ReadElementContentAsCollection <ProjectTimeEntryActivity>(); break;

                case RedmineKeys.TRACKERS: Trackers = reader.ReadElementContentAsCollection <ProjectTracker>(); break;

                case RedmineKeys.UPDATED_ON: UpdatedOn = reader.ReadElementContentAsNullableDateTime(); break;

                case RedmineKeys.DEFAULT_ASSIGNEE: DefaultAssignee = new IdentifiableName(reader); break;

                case RedmineKeys.DEFAULT_VERSION: DefaultVersion = new IdentifiableName(reader); break;

                default: reader.Read(); break;
                }
            }
        }