当前位置: 首页>>代码示例>>C#>>正文


C# IDictionary.GetValueAsIdentifiableName方法代码示例

本文整理汇总了C#中IDictionary.GetValueAsIdentifiableName方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.GetValueAsIdentifiableName方法的具体用法?C# IDictionary.GetValueAsIdentifiableName怎么用?C# IDictionary.GetValueAsIdentifiableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDictionary的用法示例。


在下文中一共展示了IDictionary.GetValueAsIdentifiableName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize

        /// <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;
        }
开发者ID:Jopie64,项目名称:redmine-net-api,代码行数:45,代码来源:TimeEntryConverter.cs

示例2: Deserialize

        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;
        }
开发者ID:Enhakiel,项目名称:redmine-net-api,代码行数:25,代码来源:ProjectConverter.cs

示例3: Deserialize

        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;
        }
开发者ID:dreampet,项目名称:redmine-net-api,代码行数:16,代码来源:ProjectMembershipConverter.cs

示例4: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueCategory = new IssueCategory();

                issueCategory.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                issueCategory.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT);
                issueCategory.AsignTo = dictionary.GetValueAsIdentifiableName(RedmineKeys.ASSIGNED_TO);
                issueCategory.Name = dictionary.GetValue<string>(RedmineKeys.NAME);

                return issueCategory;
            }

            return null;
        }
开发者ID:Enhakiel,项目名称:redmine-net-api,代码行数:16,代码来源:IssueCategoryConverter.cs

示例5: Deserialize

        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;
        }
开发者ID:KokawaTakashi,项目名称:redmine-net-api,代码行数:16,代码来源:ProjectMembershipConverter.cs

示例6: Deserialize

        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;
        }
开发者ID:Maaarek,项目名称:redmine-net-api,代码行数:25,代码来源:ProjectConverter.cs

示例7: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueCategory = new IssueCategory();

                issueCategory.Id = dictionary.GetValue<int>("id");
                issueCategory.Project = dictionary.GetValueAsIdentifiableName("project");
                issueCategory.AsignTo = dictionary.GetValueAsIdentifiableName("assigned_to");
                issueCategory.Name = dictionary.GetValue<string>("name");

                return issueCategory;
            }

            return null;
        }
开发者ID:Maaarek,项目名称:redmine-net-api,代码行数:16,代码来源:IssueCategoryConverter.cs

示例8: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var news = new News();

                news.Id = dictionary.GetValue<int>("id");
                news.Author = dictionary.GetValueAsIdentifiableName("author");
                news.CreatedOn = dictionary.GetValue<DateTime?>("created_on");
                news.Description = dictionary.GetValue<string>("description");
                news.Project = dictionary.GetValueAsIdentifiableName("project");
                news.Summary = dictionary.GetValue<string>("summary");
                news.Title = dictionary.GetValue<string>("title");

                return news;
            }
            return null;
        }
开发者ID:Maaarek,项目名称:redmine-net-api,代码行数:18,代码来源:NewsConverter.cs

示例9: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var news = new News();

                news.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                news.Author = dictionary.GetValueAsIdentifiableName(RedmineKeys.AUTHOR);
                news.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON);
                news.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION);
                news.Project = dictionary.GetValueAsIdentifiableName(RedmineKeys.PROJECT);
                news.Summary = dictionary.GetValue<string>(RedmineKeys.SUMMARY);
                news.Title = dictionary.GetValue<string>(RedmineKeys.TITLE);

                return news;
            }
            return null;
        }
开发者ID:dreampet,项目名称:redmine-net-api,代码行数:18,代码来源:NewsConverter.cs

示例10: Deserialize

        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;
        }
开发者ID:ANovitsky,项目名称:redmine-net-api,代码行数:44,代码来源:IssueConverter.cs

示例11: Deserialize

        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;
        }
开发者ID:wizicer,项目名称:redmine-net-api,代码行数:23,代码来源:TimeEntryConverter.cs

示例12: Deserialize

        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;
        }
开发者ID:Maaarek,项目名称:redmine-net-api,代码行数:40,代码来源:IssueConverter.cs

示例13: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueChild = new IssueChild
                {
                    Id = dictionary.GetValue<int>("id"),
                    Tracker = dictionary.GetValueAsIdentifiableName("tracker"),
                    Subject = dictionary.GetValue<string>("subject")
                };

                return issueChild;
            }

            return null;
        }
开发者ID:Maaarek,项目名称:redmine-net-api,代码行数:16,代码来源:IssueChildConverter.cs

示例14: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueChild = new IssueChild
                {
                    Id = dictionary.GetValue<int>(RedmineKeys.ID),
                    Tracker = dictionary.GetValueAsIdentifiableName(RedmineKeys.TRACKER),
                    Subject = dictionary.GetValue<string>(RedmineKeys.SUBJECT)
                };

                return issueChild;
            }

            return null;
        }
开发者ID:ANovitsky,项目名称:redmine-net-api,代码行数:16,代码来源:IssueChildConverter.cs

示例15: Deserialize

        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;
        }
开发者ID:KokawaTakashi,项目名称:redmine-net-api,代码行数:17,代码来源:JournalConverter.cs


注:本文中的IDictionary.GetValueAsIdentifiableName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。