本文整理汇总了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);
}
}
示例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);
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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));
}
}