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


C# SettingsDictionary.TryGetModel方法代码示例

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


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

示例1: UpdateFieldSettings

        public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
            if (builder.FieldType != "PhoneField") {
                return;
            }

            var model = settingsDictionary.TryGetModel<PhoneFieldSettings>();
            if (model != null) {
                UpdateSettings(model, builder, "PhoneFieldSettings");
                builder.WithSetting("PhoneFieldSettings.DefaultValue", model.DefaultValue);
            }
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:11,代码来源:PhoneFieldEditorEvents.cs

示例2: UpdateFieldSettings

 public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
     if (builder.FieldType != "CoeveryTextField") {
         return;
     }
     var model = settingsDictionary.TryGetModel<CoeveryTextFieldSettings>();
     if (model != null) {
         UpdateSettings(model, builder, "CoeveryTextFieldSettings");
         builder.WithSetting("CoeveryTextFieldSettings.IsDispalyField", model.IsDispalyField.ToString());
         builder.WithSetting("CoeveryTextFieldSettings.MaxLength", model.MaxLength.ToString());
         builder.WithSetting("CoeveryTextFieldSettings.PlaceHolderText", model.PlaceHolderText);
     }
 }
开发者ID:wezmag,项目名称:Coevery,代码行数:12,代码来源:CoeveryTextFieldEditorEvents.cs

示例3: UpdateFieldSettings

        public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
            if (builder.FieldType != "OptionSetField") {
                return;
            }

            var model = settingsDictionary.TryGetModel<OptionSetFieldSettings>();
            if (model != null) {
                UpdateSettings(model, builder, "OptionSetFieldSettings");
                builder.WithSetting("OptionSetFieldSettings.OptionSetId", model.OptionSetId.ToString());
                builder.WithSetting("OptionSetFieldSettings.ListMode", model.ListMode.ToString());
            }
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:12,代码来源:OptionSetFieldEditorEvents.cs

示例4: UpdateFieldSettings

        public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
            if (builder.FieldType != "NumberField") {
                return;
            }

            var model = settingsDictionary.TryGetModel<NumberFieldSettings>();
            if (model != null) {
                UpdateSettings(model, builder, "NumberFieldSettings");
                builder.WithSetting("NumberFieldSettings.Length", model.Length.ToString());
                builder.WithSetting("NumberFieldSettings.DecimalPlaces", model.DecimalPlaces.ToString());
                builder.WithSetting("NumberFieldSettings.DefaultValue", model.DefaultValue.ToString());
            }
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:13,代码来源:NumberFieldEditorEvents.cs

示例5: UpdateFieldSettings

        public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
            if (builder.FieldType != "BooleanField") {
                return;
            }

            var model = settingsDictionary.TryGetModel<BooleanFieldSettings>();
            if (model != null) {
                UpdateSettings(model, builder, "BooleanFieldSettings");
                builder.WithSetting("BooleanFieldSettings.SelectionMode", model.SelectionMode.ToString());
                builder.WithSetting("BooleanFieldSettings.DependencyMode", model.DependencyMode.ToString());
                builder.WithSetting("BooleanFieldSettings.DefaultValue", model.DefaultValue.ToString());
            }
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:13,代码来源:BooleanFieldEditorEvents.cs

示例6: UpdateFieldSettings

        public override void UpdateFieldSettings(ContentPartFieldDefinitionBuilder builder, SettingsDictionary settingsDictionary) {
            if (builder.FieldType != "ReferenceField") {
                return;
            }

            var model = settingsDictionary.TryGetModel<ReferenceFieldSettings>();
            if (model != null) {
                UpdateSettings(model, builder, "ReferenceFieldSettings");
                builder.WithSetting("ReferenceFieldSettings.DisplayAsLink", model.DisplayAsLink.ToString());
                builder.WithSetting("ReferenceFieldSettings.ContentTypeName", model.ContentTypeName);
                builder.WithSetting("ReferenceFieldSettings.RelationshipName", model.RelationshipName);
                builder.WithSetting("ReferenceFieldSettings.RelationshipId", model.RelationshipId.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("ReferenceFieldSettings.QueryId", model.QueryId.ToString(CultureInfo.InvariantCulture));
            }
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:15,代码来源:ReferenceFieldEditorEvents.cs


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