public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var project = new Project { Id = dictionary.GetValue <int>("id"), Description = dictionary.GetValue <string>("description"), HomePage = dictionary.GetValue <string>("homepage"), Name = dictionary.GetValue <string>("name"), Identifier = dictionary.GetValue <string>("identifier"), Status = dictionary.GetValue <ProjectStatus>("status"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"), Trackers = dictionary.GetValueAsCollection <ProjectTracker>("trackers"), CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"), IsPublic = dictionary.GetValue <bool>("is_public"), Parent = dictionary.GetValueAsIdentifiableName("parent"), IssueCategories = dictionary.GetValueAsCollection <ProjectIssueCategory>( "issue_categories") }; return(project); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var customField = new CustomField(); customField.Id = dictionary.GetValue<int>("id"); customField.Name = dictionary.GetValue<string>("name"); customField.CustomizedType = dictionary.GetValue<string>("customized_type"); customField.FieldFormat = dictionary.GetValue<string>("field_format"); customField.Regexp = dictionary.GetValue<string>("regexp"); customField.MinLength = dictionary.GetValue<int?>("min_length"); customField.MaxLength = dictionary.GetValue<int?>("max_length"); customField.IsRequired = dictionary.GetValue<bool>("is_required"); customField.IsFilter = dictionary.GetValue<bool>("is_filter"); customField.Searchable = dictionary.GetValue<bool>("searchable"); customField.Multiple = dictionary.GetValue<bool>("multiple"); customField.DefaultValue = dictionary.GetValue<string>("default_value"); customField.Visible = dictionary.GetValue<bool>("visible"); customField.PossibleValues = dictionary.GetValueAsCollection<CustomFieldPossibleValue>("possible_values"); customField.Trackers = dictionary.GetValueAsCollection<TrackerCustomField>("trackers"); customField.Roles = dictionary.GetValueAsCollection<CustomFieldRole>("roles"); return customField; } return null; }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var user = new User(); user.Login = dictionary.GetValue <string>(RedmineKeys.LOGIN); user.Id = dictionary.GetValue <int>(RedmineKeys.ID); user.FirstName = dictionary.GetValue <string>(RedmineKeys.FIRSTNAME); user.LastName = dictionary.GetValue <string>(RedmineKeys.LASTNAME); user.Email = dictionary.GetValue <string>(RedmineKeys.MAIL); user.AuthenticationModeId = dictionary.GetValue <int?>(RedmineKeys.AUTH_SOURCE_ID); user.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); user.LastLoginOn = dictionary.GetValue <DateTime?>(RedmineKeys.LAST_LOGIN_ON); user.ApiKey = dictionary.GetValue <string>(RedmineKeys.API_KEY); user.Status = dictionary.GetValue <UserStatus>(RedmineKeys.STATUS); user.MustChangePassword = dictionary.GetValue <bool>(RedmineKeys.MUST_CHANGE_PASSWD); user.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); user.Memberships = dictionary.GetValueAsCollection <Membership>(RedmineKeys.MEMBERSHIPS); user.Groups = dictionary.GetValueAsCollection <UserGroup>(RedmineKeys.GROUPS); return(user); } return(null); }
/// <summary> /// Deserializes the specified dictionary. /// </summary> /// <param name="dictionary">The dictionary.</param> /// <param name="type">The type.</param> /// <param name="serializer">The serializer.</param> /// <returns></returns> public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var customField = new CustomField(); customField.Id = dictionary.GetValue<int>(RedmineKeys.ID); customField.Name = dictionary.GetValue<string>(RedmineKeys.NAME); customField.CustomizedType = dictionary.GetValue<string>(RedmineKeys.CUSTOMIZED_TYPE); customField.FieldFormat = dictionary.GetValue<string>(RedmineKeys.FIELD_FORMAT); customField.Regexp = dictionary.GetValue<string>(RedmineKeys.REGEXP); customField.MinLength = dictionary.GetValue<int?>(RedmineKeys.MIN_LENGTH); customField.MaxLength = dictionary.GetValue<int?>(RedmineKeys.MAX_LENGTH); customField.IsRequired = dictionary.GetValue<bool>(RedmineKeys.IS_REQUIRED); customField.IsFilter = dictionary.GetValue<bool>(RedmineKeys.IS_FILTER); customField.Searchable = dictionary.GetValue<bool>(RedmineKeys.SEARCHABLE); customField.Multiple = dictionary.GetValue<bool>(RedmineKeys.MULTIPLE); customField.DefaultValue = dictionary.GetValue<string>(RedmineKeys.DEFAULT_VALUE); customField.Visible = dictionary.GetValue<bool>(RedmineKeys.VISIBLE); customField.PossibleValues = dictionary.GetValueAsCollection<CustomFieldPossibleValue>(RedmineKeys.POSSIBLE_VALUES); customField.Trackers = dictionary.GetValueAsCollection<TrackerCustomField>(RedmineKeys.TRACKERS); customField.Roles = dictionary.GetValueAsCollection<CustomFieldRole>(RedmineKeys.ROLES); return customField; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var project = new Project(); project.Id = dictionary.GetValue<int>(RedmineKeys.ID); project.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION); project.HomePage = dictionary.GetValue<string>(RedmineKeys.HOMEPAGE); project.Name = dictionary.GetValue<string>(RedmineKeys.NAME); project.Identifier = dictionary.GetValue<string>(RedmineKeys.IDENTIFIER); project.Status = dictionary.GetValue<ProjectStatus>(RedmineKeys.STATUS); project.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); project.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON); project.Trackers = dictionary.GetValueAsCollection<ProjectTracker>(RedmineKeys.TRACKERS); project.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); project.IsPublic = dictionary.GetValue<bool>(RedmineKeys.IS_PUBLIC); project.Parent = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT); project.IssueCategories = dictionary.GetValueAsCollection<ProjectIssueCategory>(RedmineKeys.ISSUE_CATEGORIES); project.EnabledModules = dictionary.GetValueAsCollection<ProjectEnabledModule>(RedmineKeys.ENABLED_MODULES); return project; } return null; }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var project = new Project(); project.Id = dictionary.GetValue <int>(RedmineKeys.ID); project.Description = dictionary.GetValue <string>(RedmineKeys.DESCRIPTION); project.HomePage = dictionary.GetValue <string>(RedmineKeys.HOMEPAGE); project.Name = dictionary.GetValue <string>(RedmineKeys.NAME); project.Identifier = dictionary.GetValue <string>(RedmineKeys.IDENTIFIER); project.Status = dictionary.GetValue <ProjectStatus>(RedmineKeys.STATUS); project.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); project.UpdatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.UPDATED_ON); project.Trackers = dictionary.GetValueAsCollection <ProjectTracker>(RedmineKeys.TRACKERS); project.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); project.IsPublic = dictionary.GetValue <bool>(RedmineKeys.IS_PUBLIC); project.Parent = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT); project.IssueCategories = dictionary.GetValueAsCollection <ProjectIssueCategory>(RedmineKeys.ISSUE_CATEGORIES); project.EnabledModules = dictionary.GetValueAsCollection <ProjectEnabledModule>(RedmineKeys.ENABLED_MODULES); project.TimeEntryActivities = dictionary.GetValueAsCollection <TimeEntryActivity>(RedmineKeys.TIME_ENTRY_ACTIVITIES); return(project); } return(null); }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var user = new User(); user.Login = dictionary.GetValue<string>(RedmineKeys.LOGIN); user.Id = dictionary.GetValue<int>(RedmineKeys.ID); user.FirstName = dictionary.GetValue<string>(RedmineKeys.FIRSTNAME); user.LastName = dictionary.GetValue<string>(RedmineKeys.LASTNAME); user.Email = dictionary.GetValue<string>(RedmineKeys.MAIL); user.AuthenticationModeId = dictionary.GetValue<int?>(RedmineKeys.AUTH_SOURCE_ID); user.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); user.LastLoginOn = dictionary.GetValue<DateTime?>(RedmineKeys.LAST_LOGIN_ON); user.ApiKey = dictionary.GetValue<string>(RedmineKeys.API_KEY); user.Status = dictionary.GetValue<UserStatus>(RedmineKeys.STATUS); user.MustChangePassword = dictionary.GetValue<bool>(RedmineKeys.MUST_CHANGE_PASSWD); user.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); user.Memberships = dictionary.GetValueAsCollection<Membership>(RedmineKeys.MEMBERSHIPS); user.Groups = dictionary.GetValueAsCollection<UserGroup>(RedmineKeys.GROUPS); return user; } return null; }
/// <summary> /// Deserializes the specified dictionary. /// </summary> /// <param name="dictionary">The dictionary.</param> /// <param name="type">The type.</param> /// <param name="serializer">The serializer.</param> /// <returns></returns> public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var customField = new CustomField(); customField.Id = dictionary.GetValue <int>(RedmineKeys.ID); customField.Name = dictionary.GetValue <string>(RedmineKeys.NAME); customField.CustomizedType = dictionary.GetValue <string>(RedmineKeys.CUSTOMIZED_TYPE); customField.FieldFormat = dictionary.GetValue <string>(RedmineKeys.FIELD_FORMAT); customField.Regexp = dictionary.GetValue <string>(RedmineKeys.REGEXP); customField.MinLength = dictionary.GetValue <int?>(RedmineKeys.MIN_LENGTH); customField.MaxLength = dictionary.GetValue <int?>(RedmineKeys.MAX_LENGTH); customField.IsRequired = dictionary.GetValue <bool>(RedmineKeys.IS_REQUIRED); customField.IsFilter = dictionary.GetValue <bool>(RedmineKeys.IS_FILTER); customField.Searchable = dictionary.GetValue <bool>(RedmineKeys.SEARCHABLE); customField.Multiple = dictionary.GetValue <bool>(RedmineKeys.MULTIPLE); customField.DefaultValue = dictionary.GetValue <string>(RedmineKeys.DEFAULT_VALUE); customField.Visible = dictionary.GetValue <bool>(RedmineKeys.VISIBLE); customField.PossibleValues = dictionary.GetValueAsCollection <CustomFieldPossibleValue>(RedmineKeys.POSSIBLE_VALUES); customField.Trackers = dictionary.GetValueAsCollection <TrackerCustomField>(RedmineKeys.TRACKERS); customField.Roles = dictionary.GetValueAsCollection <CustomFieldRole>(RedmineKeys.ROLES); return(customField); } return(null); }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var user = new User { Login = dictionary.GetValue <string>("login"), Id = dictionary.GetValue <int>("id"), FirstName = dictionary.GetValue <string>("firstname"), LastName = dictionary.GetValue <string>("lastname"), Email = dictionary.GetValue <string>("mail"), AuthenticationModeId = dictionary.GetValue <int?>("auth_source_id"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), LastLoginOn = dictionary.GetValue <DateTime?>("last_login_on"), ApiKey = dictionary.GetValue <string>("api_key"), Status = dictionary.GetValue <UserStatus>("status"), CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"), Memberships = dictionary.GetValueAsCollection <Membership>("memberships"), Groups = dictionary.GetValueAsCollection <UserGroup>("groups") }; return(user); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var project = new Project(); project.Id = dictionary.GetValue <int>("id"); project.Description = dictionary.GetValue <string>("description"); project.HomePage = dictionary.GetValue <string>("homepage"); project.Name = dictionary.GetValue <string>("name"); project.Identifier = dictionary.GetValue <string>("identifier"); project.Status = dictionary.GetValue <ProjectStatus>("status"); project.CreatedOn = dictionary.GetValue <DateTime?>("created_on"); project.UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"); project.Trackers = dictionary.GetValueAsCollection <ProjectTracker>("trackers"); project.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"); project.IsPublic = dictionary.GetValue <bool>("is_public"); project.Parent = dictionary.GetValueAsIdentifiableName("parent"); project.IssueCategories = dictionary.GetValueAsCollection <ProjectIssueCategory>("issue_categories"); project.EnabledModules = dictionary.GetValueAsCollection <ProjectEnabledModule>("enabled_modules"); return(project); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var project = new Project(); project.Id = dictionary.GetValue<int>("id"); project.Description = dictionary.GetValue<string>("description"); project.HomePage = dictionary.GetValue<string>("homepage"); project.Name = dictionary.GetValue<string>("name"); project.Identifier = dictionary.GetValue<string>("identifier"); project.Status = dictionary.GetValue<ProjectStatus>("status"); project.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); project.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on"); project.Trackers = dictionary.GetValueAsCollection<ProjectTracker>("trackers"); project.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); project.IsPublic = dictionary.GetValue<bool>("is_public"); project.Parent = dictionary.GetValueAsIdentifiableName("parent"); project.IssueCategories = dictionary.GetValueAsCollection<ProjectIssueCategory>("issue_categories"); project.EnabledModules = dictionary.GetValueAsCollection<ProjectEnabledModule>("enabled_modules"); return project; } return null; }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var tracker = new WikiPage { Id = dictionary.GetValue <int>("id"), Author = dictionary.GetValueAsIdentifiableName("author"), Comments = dictionary.GetValue <string>("comments"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), Text = dictionary.GetValue <string>("text"), Title = dictionary.GetValue <string>("title"), UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"), Version = dictionary.GetValue <int>("version"), Attachments = dictionary.GetValueAsCollection <Attachment>("attachments") }; return(tracker); }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var timeEntry = new TimeEntry(); timeEntry.Id = dictionary.GetValue<int>(RedmineKeys.ID); timeEntry.Activity = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.ACTIVITY) ? RedmineKeys.ACTIVITY : RedmineKeys.ACTIVITY_ID); timeEntry.Comments = dictionary.GetValue<string>(RedmineKeys.COMMENTS); timeEntry.Hours = dictionary.GetValue<decimal>(RedmineKeys.HOURS); timeEntry.Issue = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.ISSUE) ? RedmineKeys.ISSUE : RedmineKeys.ISSUE_ID); timeEntry.Project = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.PROJECT) ? RedmineKeys.PROJECT : RedmineKeys.PROJECT_ID); timeEntry.SpentOn = dictionary.GetValue<DateTime?>(RedmineKeys.SPENT_ON); timeEntry.User = dictionary.GetValueAsIdentifiableName(RedmineKeys.USER); timeEntry.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); timeEntry.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); timeEntry.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON); return timeEntry; } return null; }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var version = new Version { Id = dictionary.GetValue <int>("id"), Description = dictionary.GetValue <string>("description"), Name = dictionary.GetValue <string>("name"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"), DueDate = dictionary.GetValue <DateTime?>("due_date"), Project = dictionary.GetValueAsIdentifiableName("project"), Sharing = dictionary.GetValue <VersionSharing>("sharing"), Status = dictionary.GetValue <VersionStatus>("status"), CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields") }; return(version); }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var timeEntry = new TimeEntry(); timeEntry.Id = dictionary.GetValue <int>(RedmineKeys.ID); timeEntry.Activity = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.ACTIVITY) ? RedmineKeys.ACTIVITY : RedmineKeys.ACTIVITY_ID); timeEntry.Comments = dictionary.GetValue <string>(RedmineKeys.COMMENTS); timeEntry.Hours = dictionary.GetValue <decimal>(RedmineKeys.HOURS); timeEntry.Issue = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.ISSUE) ? RedmineKeys.ISSUE : RedmineKeys.ISSUE_ID); timeEntry.Project = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey(RedmineKeys.PROJECT) ? RedmineKeys.PROJECT : RedmineKeys.PROJECT_ID); timeEntry.SpentOn = dictionary.GetValue <DateTime?>(RedmineKeys.SPENT_ON); timeEntry.User = dictionary.GetValueAsIdentifiableName(RedmineKeys.USER); timeEntry.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); timeEntry.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); timeEntry.UpdatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.UPDATED_ON); return(timeEntry); } return(null); }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var timeEntry = new TimeEntry { Id = dictionary.GetValue <int>("id"), Activity = dictionary.GetValueAsIdentifiableName( dictionary.ContainsKey("activity") ? "activity" : "activity_id"), Comments = dictionary.GetValue <string>("comments"), Hours = dictionary.GetValue <decimal>("hours"), Issue = dictionary.GetValueAsIdentifiableName( dictionary.ContainsKey("issue") ? "issue" : "issue_id"), Project = dictionary.GetValueAsIdentifiableName( dictionary.ContainsKey("project") ? "project" : "project_id"), SpentOn = dictionary.GetValue <DateTime?>("spent_on"), User = dictionary.GetValueAsIdentifiableName("user"), CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), UpdatedOn = dictionary.GetValue <DateTime?>("updated_on") }; return(timeEntry); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var group = new Group(); group.Id = dictionary.GetValue<int>(RedmineKeys.ID); group.Name = dictionary.GetValue<string>(RedmineKeys.NAME); group.Users = dictionary.GetValueAsCollection<GroupUser>(RedmineKeys.USERS); group.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); group.Memberships = dictionary.GetValueAsCollection<Membership>(RedmineKeys.MEMBERSHIPS); return group; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var group = new Group(); group.Id = dictionary.GetValue <int>(RedmineKeys.ID); group.Name = dictionary.GetValue <string>(RedmineKeys.NAME); group.Users = dictionary.GetValueAsCollection <GroupUser>(RedmineKeys.USERS); group.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); group.Memberships = dictionary.GetValueAsCollection <Membership>(RedmineKeys.MEMBERSHIPS); return(group); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var group = new Group(); group.Id = dictionary.GetValue<int>("id"); group.Name = dictionary.GetValue<string>("name"); group.Users = dictionary.GetValueAsCollection<User>("users"); group.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); group.Memberships = dictionary.GetValueAsCollection<Membership>("memberships"); return group; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var group = new Group(); group.Id = dictionary.GetValue <int>("id"); group.Name = dictionary.GetValue <string>("name"); group.Users = dictionary.GetValueAsCollection <User>("users"); group.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"); group.Memberships = dictionary.GetValueAsCollection <Membership>("memberships"); return(group); } return(null); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { User user = new User(); user.Login = dictionary.GetValue <string>("login"); user.Id = dictionary.GetValue <int>("id"); user.FirstName = dictionary.GetValue <string>("firstname"); user.LastName = dictionary.GetValue <string>("lastname"); user.Email = dictionary.GetValue <string>("mail"); user.AuthenticationModeId = dictionary.GetValue <int?>("auth_source_id"); user.CreatedOn = dictionary.GetValue <DateTime?>("created_on"); user.LastLoginOn = dictionary.GetValue <DateTime?>("last_login_on"); user.CustomFields = dictionary.GetValueAsCollection <CustomField>("custom_fields"); user.Memberships = dictionary.GetValueAsCollection <Membership>("memberships"); user.Groups = dictionary.GetValueAsCollection <UserGroup>("groups"); return(user); } return(null); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var role = new Role(); role.Id = dictionary.GetValue <int>("id"); role.Name = dictionary.GetValue <string>("name"); role.Permissions = dictionary.GetValueAsCollection <Permission>("permissions"); return(role); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { User user = new User(); user.Login = dictionary.GetValue<string>("login"); user.Id = dictionary.GetValue<int>("id"); user.FirstName = dictionary.GetValue<string>("firstname"); user.LastName = dictionary.GetValue<string>("lastname"); user.Email = dictionary.GetValue<string>("mail"); user.AuthenticationModeId = dictionary.GetValue<int?>("auth_source_id"); user.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); user.LastLoginOn = dictionary.GetValue<DateTime?>("last_login_on"); user.ApiKey = dictionary.GetValue<string>("api_key"); user.Status = dictionary.GetValue<UserStatus>("status"); user.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); user.Memberships = dictionary.GetValueAsCollection<Membership>("memberships"); user.Groups = dictionary.GetValueAsCollection<UserGroup>("groups"); return user; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var role = new Role(); role.Id = dictionary.GetValue<int>("id"); role.Name = dictionary.GetValue<string>("name"); role.Permissions = dictionary.GetValueAsCollection<Permission>("permissions"); return role; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var membership = new Membership(); membership.Id = dictionary.GetValue<int>(RedmineKeys.ID); membership.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); membership.Roles = dictionary.GetValueAsCollection<MembershipRole>(RedmineKeys.ROLES); return membership; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var membership = new Membership(); membership.Id = dictionary.GetValue <int>("id"); membership.Project = dictionary.GetValueAsIdentifiableName("project"); membership.Roles = dictionary.GetValueAsCollection <MembershipRole>("roles"); return(membership); } return(null); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var issue = new Issue(); issue.Id = dictionary.GetValue <int>("id"); issue.Description = dictionary.GetValue <string>("description"); issue.Project = dictionary.GetValueAsIdentifiableName("project"); issue.Tracker = dictionary.GetValueAsIdentifiableName("tracker"); issue.Status = dictionary.GetValueAsIdentifiableName("status"); issue.CreatedOn = dictionary.GetValue <DateTime?>("created_on"); issue.UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"); issue.Priority = dictionary.GetValueAsIdentifiableName("priority"); issue.Author = dictionary.GetValueAsIdentifiableName("author"); issue.AssignedTo = dictionary.GetValueAsIdentifiableName("assigned_to"); issue.Category = dictionary.GetValueAsIdentifiableName("category"); issue.FixedVersion = dictionary.GetValueAsIdentifiableName("fixed_version"); issue.Subject = dictionary.GetValue <string>("subject"); issue.Notes = dictionary.GetValue <string>("notes"); issue.StartDate = dictionary.GetValue <DateTime?>("start_date"); issue.DueDate = dictionary.GetValue <DateTime?>("due_date"); issue.DoneRatio = dictionary.GetValue <float>("done_ratio"); issue.EstimatedHours = dictionary.GetValue <float>("estimated_hours"); issue.ParentIssue = dictionary.GetValueAsIdentifiableName("parent"); issue.CustomFields = dictionary.GetValueAsCollection <CustomField>("custom_fields"); issue.Attachments = dictionary.GetValueAsCollection <Attachment>("attachments"); issue.Relations = dictionary.GetValueAsCollection <IssueRelation>("relations"); issue.Journals = dictionary.GetValueAsCollection <Journal>("journals"); issue.Changesets = dictionary.GetValueAsCollection <ChangeSet>("changesets"); return(issue); } return(null); }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var membership = new Membership(); membership.Id = dictionary.GetValue<int>(RedmineKeys.ID); membership.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); membership.Roles = dictionary.GetValueAsCollection<MembershipRole>(RedmineKeys.ROLES); return membership; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var projectMembership = new ProjectMembership(); projectMembership.Id = dictionary.GetValue<int>("id"); projectMembership.Group = dictionary.GetValueAsIdentifiableName("group"); projectMembership.Project = dictionary.GetValueAsIdentifiableName("project"); projectMembership.Roles = dictionary.GetValueAsCollection<MembershipRole>("roles"); projectMembership.User = dictionary.GetValueAsIdentifiableName("user"); return projectMembership; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var projectMembership = new ProjectMembership(); projectMembership.Id = dictionary.GetValue <int>(RedmineKeys.ID); projectMembership.Group = dictionary.GetValueAsIdentifiableName(RedmineKeys.GROUP); projectMembership.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); projectMembership.Roles = dictionary.GetValueAsCollection <MembershipRole>(RedmineKeys.ROLES); projectMembership.User = dictionary.GetValueAsIdentifiableName(RedmineKeys.USER); return(projectMembership); } return(null); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var journal = new Journal(); journal.Id = dictionary.GetValue <int>("id"); journal.Notes = dictionary.GetValue <string>("notes"); journal.User = dictionary.GetValueAsIdentifiableName("user"); journal.CreatedOn = dictionary.GetValue <DateTime?>("created_on"); journal.Details = dictionary.GetValueAsCollection <Detail>("details"); return(journal); } return(null); }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var journal = new Journal(); journal.Id = dictionary.GetValue <int>(RedmineKeys.ID); journal.Notes = dictionary.GetValue <string>(RedmineKeys.NOTES); journal.User = dictionary.GetValueAsIdentifiableName(RedmineKeys.USER); journal.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); journal.Details = dictionary.GetValueAsCollection <Detail>(RedmineKeys.DETAILS); return(journal); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var journal = new Journal(); journal.Id = dictionary.GetValue<int>(RedmineKeys.ID); journal.Notes = dictionary.GetValue<string>(RedmineKeys.NOTES); journal.User = dictionary.GetValueAsIdentifiableName(RedmineKeys.USER); journal.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); journal.Details = dictionary.GetValueAsCollection<Detail>(RedmineKeys.DETAILS); return journal; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var journal = new Journal(); journal.Id = dictionary.GetValue<int>("id"); journal.Notes = dictionary.GetValue<string>("notes"); journal.User = dictionary.GetValueAsIdentifiableName("user"); journal.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); journal.Details = dictionary.GetValueAsCollection<Detail>("details"); return journal; } return null; }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var issue = new Issue { Id = dictionary.GetValue <int>("id"), Description = dictionary.GetValue <string>("description"), Project = dictionary.GetValueAsIdentifiableName("project"), Tracker = dictionary.GetValueAsIdentifiableName("tracker"), Status = dictionary.GetValueAsIdentifiableName("status"), CreatedOn = dictionary.GetValue <DateTime?>("created_on"), UpdatedOn = dictionary.GetValue <DateTime?>("updated_on"), ClosedOn = dictionary.GetValue <DateTime?>("closed_on"), Priority = dictionary.GetValueAsIdentifiableName("priority"), Author = dictionary.GetValueAsIdentifiableName("author"), AssignedTo = dictionary.GetValueAsIdentifiableName("assigned_to"), Category = dictionary.GetValueAsIdentifiableName("category"), FixedVersion = dictionary.GetValueAsIdentifiableName( "fixed_version"), Subject = dictionary.GetValue <string>("subject"), Notes = dictionary.GetValue <string>("notes"), StartDate = dictionary.GetValue <DateTime?>("start_date"), DueDate = dictionary.GetValue <DateTime?>("due_date"), DoneRatio = dictionary.GetValue <float>("done_ratio"), EstimatedHours = dictionary.GetValue <float>("estimated_hours"), ParentIssue = dictionary.GetValueAsIdentifiableName("parent"), CustomFields = dictionary.GetValueAsCollection <IssueCustomField>("custom_fields"), Attachments = dictionary.GetValueAsCollection <Attachment>("attachments"), Relations = dictionary.GetValueAsCollection <IssueRelation>("relations"), Journals = dictionary.GetValueAsCollection <Journal>("journals"), Changesets = dictionary.GetValueAsCollection <ChangeSet>( "changesets"), Watchers = dictionary.GetValueAsCollection <Watcher>("watchers"), Children = dictionary.GetValueAsCollection <IssueChild>("children") }; return(issue); }
/// <summary> /// When overridden in a derived class, converts the provided dictionary into an object of the specified type. /// </summary> /// <param name="dictionary"> /// An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored /// as name/value pairs. /// </param> /// <param name="type">The type of the resulting object.</param> /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param> /// <returns> /// The deserialized object. /// </returns> public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var issue = new Issue(); issue.Id = dictionary.GetValue <int>(RedmineKeys.ID); issue.Description = dictionary.GetValue <string>(RedmineKeys.DESCRIPTION); issue.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); issue.Tracker = dictionary.GetValueAsIdentifiableName(RedmineKeys.TRACKER); issue.Status = dictionary.GetValueAsIdentifiableName(RedmineKeys.STATUS); issue.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); issue.UpdatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.UPDATED_ON); issue.ClosedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CLOSED_ON); issue.Priority = dictionary.GetValueAsIdentifiableName(RedmineKeys.PRIORITY); issue.Author = dictionary.GetValueAsIdentifiableName(RedmineKeys.AUTHOR); issue.AssignedTo = dictionary.GetValueAsIdentifiableName(RedmineKeys.ASSIGNED_TO); issue.Category = dictionary.GetValueAsIdentifiableName(RedmineKeys.CATEGORY); issue.FixedVersion = dictionary.GetValueAsIdentifiableName(RedmineKeys.FIXED_VERSION); issue.Subject = dictionary.GetValue <string>(RedmineKeys.SUBJECT); issue.Notes = dictionary.GetValue <string>(RedmineKeys.NOTES); issue.IsPrivate = dictionary.GetValue <bool>(RedmineKeys.IS_PRIVATE); issue.StartDate = dictionary.GetValue <DateTime?>(RedmineKeys.START_DATE); issue.DueDate = dictionary.GetValue <DateTime?>(RedmineKeys.DUE_DATE); issue.SpentHours = dictionary.GetValue <float?>(RedmineKeys.SPENT_HOURS); issue.TotalSpentHours = dictionary.GetValue <float?>(RedmineKeys.TOTAL_SPENT_HOURS); issue.DoneRatio = dictionary.GetValue <float?>(RedmineKeys.DONE_RATIO); issue.EstimatedHours = dictionary.GetValue <float?>(RedmineKeys.ESTIMATED_HOURS); issue.TotalEstimatedHours = dictionary.GetValue <float?>(RedmineKeys.TOTAL_ESTIMATED_HOURS); issue.ParentIssue = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT); issue.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); issue.Attachments = dictionary.GetValueAsCollection <Attachment>(RedmineKeys.ATTACHMENTS); issue.Relations = dictionary.GetValueAsCollection <IssueRelation>(RedmineKeys.RELATIONS); issue.Journals = dictionary.GetValueAsCollection <Journal>(RedmineKeys.JOURNALS); issue.Changesets = dictionary.GetValueAsCollection <ChangeSet>(RedmineKeys.CHANGESETS); issue.Watchers = dictionary.GetValueAsCollection <Watcher>(RedmineKeys.WATCHERS); issue.Children = dictionary.GetValueAsCollection <IssueChild>(RedmineKeys.CHILDREN); return(issue); } return(null); }
public override object Deserialize( IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary == null) { return(null); } var projectMembership = new ProjectMembership { Id = dictionary.GetValue <int>("id"), Group = dictionary.GetValueAsIdentifiableName("group"), Project = dictionary.GetValueAsIdentifiableName("project"), Roles = dictionary.GetValueAsCollection <MembershipRole>("roles"), User = dictionary.GetValueAsIdentifiableName("user") }; return(projectMembership); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var issue = new Issue(); issue.Id = dictionary.GetValue<int>(RedmineKeys.ID); issue.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION); issue.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); issue.Tracker = dictionary.GetValueAsIdentifiableName(RedmineKeys.TRACKER); issue.Status = dictionary.GetValueAsIdentifiableName(RedmineKeys.STATUS); issue.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); issue.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON); issue.ClosedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CLOSED_ON); issue.Priority = dictionary.GetValueAsIdentifiableName(RedmineKeys.PRIORITY); issue.Author = dictionary.GetValueAsIdentifiableName(RedmineKeys.AUTHOR); issue.AssignedTo = dictionary.GetValueAsIdentifiableName(RedmineKeys.ASSIGNED_TO); issue.Category = dictionary.GetValueAsIdentifiableName(RedmineKeys.CATEGORY); issue.FixedVersion = dictionary.GetValueAsIdentifiableName(RedmineKeys.FIXED_VERSION); issue.Subject = dictionary.GetValue<string>(RedmineKeys.SUBJECT); issue.Notes = dictionary.GetValue<string>(RedmineKeys.NOTES); issue.IsPrivate = dictionary.GetValue<bool>(RedmineKeys.IS_PRIVATE); issue.StartDate = dictionary.GetValue<DateTime?>(RedmineKeys.START_DATE); issue.DueDate = dictionary.GetValue<DateTime?>(RedmineKeys.DUE_DATE); issue.DoneRatio = dictionary.GetValue<float>(RedmineKeys.DONE_RATIO); issue.EstimatedHours = dictionary.GetValue<float>(RedmineKeys.ESTIMATED_HOURS); issue.SpentHours = dictionary.GetValue<float>(RedmineKeys.SPENT_HOURS); issue.ParentIssue = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT); issue.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); issue.Attachments = dictionary.GetValueAsCollection<Attachment>(RedmineKeys.ATTACHMENTS); issue.Relations = dictionary.GetValueAsCollection<IssueRelation>(RedmineKeys.RELATIONS); issue.Journals = dictionary.GetValueAsCollection<Journal>(RedmineKeys.JOURNALS); issue.Changesets = dictionary.GetValueAsCollection<ChangeSet>(RedmineKeys.CHANGESETS); issue.Watchers = dictionary.GetValueAsCollection<Watcher>(RedmineKeys.WATCHERS); issue.Children = dictionary.GetValueAsCollection<IssueChild>(RedmineKeys.CHILDREN); //easy redmine issue.ActivityId = dictionary.GetValue<int?>(RedmineKeys.ACTIVITY_ID); return issue; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var tracker = new WikiPage(); tracker.Id = dictionary.GetValue <int>(RedmineKeys.ID); tracker.Author = dictionary.GetValueAsIdentifiableName(RedmineKeys.AUTHOR); tracker.Comments = dictionary.GetValue <string>(RedmineKeys.COMMENTS); tracker.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); tracker.Text = dictionary.GetValue <string>(RedmineKeys.TEXT); tracker.Title = dictionary.GetValue <string>(RedmineKeys.TITLE); tracker.UpdatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.UPDATED_ON); tracker.Version = dictionary.GetValue <int>(RedmineKeys.VERSION); tracker.Attachments = dictionary.GetValueAsCollection <Attachment>(RedmineKeys.ATTACHMENTS); return(tracker); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var tracker = new WikiPage(); tracker.Id = dictionary.GetValue<int>("id"); tracker.Author = dictionary.GetValueAsIdentifiableName("author"); tracker.Comments = dictionary.GetValue<string>("comments"); tracker.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); tracker.Text = dictionary.GetValue<string>("text"); tracker.Title = dictionary.GetValue<string>("title"); tracker.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on"); tracker.Version = dictionary.GetValue<int>("version"); tracker.Attachments = dictionary.GetValueAsCollection<Attachment>("attachments"); return tracker; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var tracker = new WikiPage(); tracker.Id = dictionary.GetValue<int>(RedmineKeys.ID); tracker.Author = dictionary.GetValueAsIdentifiableName(RedmineKeys.AUTHOR); tracker.Comments = dictionary.GetValue<string>(RedmineKeys.COMMENTS); tracker.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); tracker.Text = dictionary.GetValue<string>(RedmineKeys.TEXT); tracker.Title = dictionary.GetValue<string>(RedmineKeys.TITLE); tracker.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON); tracker.Version = dictionary.GetValue<int>(RedmineKeys.VERSION); tracker.Attachments = dictionary.GetValueAsCollection<Attachment>(RedmineKeys.ATTACHMENTS); return tracker; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var version = new Version(); version.Id = dictionary.GetValue<int>(RedmineKeys.ID); version.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION); version.Name = dictionary.GetValue<string>(RedmineKeys.NAME); version.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON); version.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON); version.DueDate = dictionary.GetValue<DateTime?>(RedmineKeys.DUE_DATE); version.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); version.Sharing = dictionary.GetValue<VersionSharing>(RedmineKeys.SHARING); version.Status = dictionary.GetValue<VersionStatus>(RedmineKeys.STATUS); version.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); return version; } return null; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var version = new Version(); version.Id = dictionary.GetValue <int>(RedmineKeys.ID); version.Description = dictionary.GetValue <string>(RedmineKeys.DESCRIPTION); version.Name = dictionary.GetValue <string>(RedmineKeys.NAME); version.CreatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.CREATED_ON); version.UpdatedOn = dictionary.GetValue <DateTime?>(RedmineKeys.UPDATED_ON); version.DueDate = dictionary.GetValue <DateTime?>(RedmineKeys.DUE_DATE); version.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT); version.Sharing = dictionary.GetValue <VersionSharing>(RedmineKeys.SHARING); version.Status = dictionary.GetValue <VersionStatus>(RedmineKeys.STATUS); version.CustomFields = dictionary.GetValueAsCollection <IssueCustomField>(RedmineKeys.CUSTOM_FIELDS); return(version); } return(null); }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var version = new Version(); version.Id = dictionary.GetValue<int>("id"); version.Description = dictionary.GetValue<string>("description"); version.Name = dictionary.GetValue<string>("name"); version.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); version.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on"); version.DueDate = dictionary.GetValue<DateTime?>("due_date"); version.Project = dictionary.GetValueAsIdentifiableName("project"); version.Sharing = dictionary.GetValue<VersionSharing>("sharing"); version.Status = dictionary.GetValue<VersionStatus>("status"); version.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); return version; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var timeEntry = new TimeEntry(); timeEntry.Id = dictionary.GetValue<int>("id"); timeEntry.Activity = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey("activity") ? "activity" : "activity_id"); timeEntry.Comments = dictionary.GetValue<string>("comments"); timeEntry.Hours = dictionary.GetValue<decimal>("hours"); timeEntry.Issue = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey("issue") ? "issue" : "issue_id"); timeEntry.Project = dictionary.GetValueAsIdentifiableName(dictionary.ContainsKey("project") ? "project" : "project_id"); timeEntry.SpentOn = dictionary.GetValue<DateTime?>("spent_on"); timeEntry.User = dictionary.GetValueAsIdentifiableName("user"); timeEntry.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); timeEntry.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); timeEntry.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on"); return timeEntry; } return null; }
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer) { if (dictionary != null) { var issue = new Issue(); issue.Id = dictionary.GetValue<int>("id"); issue.Description = dictionary.GetValue<string>("description"); issue.Project = dictionary.GetValueAsIdentifiableName("project"); issue.Tracker = dictionary.GetValueAsIdentifiableName("tracker"); issue.Status = dictionary.GetValueAsIdentifiableName("status"); issue.CreatedOn = dictionary.GetValue<DateTime?>("created_on"); issue.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on"); issue.ClosedOn = dictionary.GetValue<DateTime?>("closed_on"); issue.Priority = dictionary.GetValueAsIdentifiableName("priority"); issue.Author = dictionary.GetValueAsIdentifiableName("author"); issue.AssignedTo = dictionary.GetValueAsIdentifiableName("assigned_to"); issue.Category = dictionary.GetValueAsIdentifiableName("category"); issue.FixedVersion = dictionary.GetValueAsIdentifiableName("fixed_version"); issue.Subject = dictionary.GetValue<string>("subject"); issue.Notes = dictionary.GetValue<string>("notes"); issue.IsPrivate = dictionary.GetValue<bool>("is_private"); issue.StartDate = dictionary.GetValue<DateTime?>("start_date"); issue.DueDate = dictionary.GetValue<DateTime?>("due_date"); issue.DoneRatio = dictionary.GetValue<float>("done_ratio"); issue.EstimatedHours = dictionary.GetValue<float>("estimated_hours"); issue.ParentIssue = dictionary.GetValueAsIdentifiableName("parent"); issue.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields"); issue.Attachments = dictionary.GetValueAsCollection<Attachment>("attachments"); issue.Relations = dictionary.GetValueAsCollection<IssueRelation>("relations"); issue.Journals = dictionary.GetValueAsCollection<Journal>("journals"); issue.Changesets = dictionary.GetValueAsCollection<ChangeSet>("changesets"); issue.Watchers = dictionary.GetValueAsCollection<Watcher>("watchers"); issue.Children = dictionary.GetValueAsCollection<IssueChild>("children"); return issue; } return null; }