public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "InputField")
            {
                yield break;
            }

            var model = new InputFieldSettings();

            if (updateModel.TryUpdateModel(model, "InputFieldSettings", null, null))
            {
                builder.WithSetting("InputFieldSettings.Type", model.Type.ToString());
                builder.WithSetting("InputFieldSettings.Title", model.Title);
                builder.WithSetting("InputFieldSettings.Hint", model.Hint);
                builder.WithSetting("InputFieldSettings.Required", model.Required.ToString());
                builder.WithSetting("InputFieldSettings.AutoFocus", model.AutoFocus.ToString());
                builder.WithSetting("InputFieldSettings.AutoComplete", model.AutoComplete.ToString());
                builder.WithSetting("InputFieldSettings.Placeholder", model.Placeholder);
                builder.WithSetting("InputFieldSettings.Pattern", model.Pattern);
                builder.WithSetting("InputFieldSettings.EditorCssClass", model.EditorCssClass);
                builder.WithSetting("InputFieldSettings.MaxLength", model.MaxLength.ToString());
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(
            ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType == "HiddenStringField")
            {
                var model = new HiddenStringFieldSettingsEventsViewModel {
                    Settings        = new HiddenStringFieldSettings(),
                    ProcessVariant  = HiddenStringFieldUpdateProcessVariant.None,
                    ProcessVariants = GetVariants()
                };
                if (updateModel.TryUpdateModel(model, "HiddenStringFieldSettingsEventsViewModel", null, null))
                {
                    builder.WithSetting("HiddenStringFieldSettings.Tokenized", model.Settings.Tokenized.ToString());
                    builder.WithSetting("HiddenStringFieldSettings.TemplateString", model.Settings.TemplateString);
                    builder.WithSetting("HiddenStringFieldSettings.AutomaticAdjustmentOnEdit", model.Settings.AutomaticAdjustmentOnEdit.ToString());

                    if (model.ProcessVariant != HiddenStringFieldUpdateProcessVariant.None)
                    {
                        // TODO: Check task isn't already scheduled.
                        var completeFieldName = _contentTypeName + "_" + builder.PartName + "_" + builder.Name + "_" + model.ProcessVariant.ToString();
                        _scheduledTaskManager.CreateTask(HiddenStringFieldValueUpdateTaskHandler.UPDATEVALUES_TASK + "_" + completeFieldName, _clock.UtcNow.AddMinutes(1), null);
                    }

                    model.ProcessVariant = HiddenStringFieldUpdateProcessVariant.None;
                    yield return(DefinitionTemplate(model));
                }
            }
            else
            {
                yield break;
            }
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(
            ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType == "HiddenStringField")
            {
                var model = new HiddenStringFieldSettingsEventsViewModel {
                    Settings        = new HiddenStringFieldSettings(),
                    ProcessVariant  = HiddenStringFieldUpdateProcessVariant.None,
                    ProcessVariants = _updateProcessor.GetVariants()
                };
                if (updateModel.TryUpdateModel(model, "HiddenStringFieldSettingsEventsViewModel", null, null))
                {
                    builder.WithSetting("HiddenStringFieldSettings.Tokenized", model.Settings.Tokenized.ToString());
                    builder.WithSetting("HiddenStringFieldSettings.TemplateString", model.Settings.TemplateString);

                    _updateProcessor.AddTask(model.ProcessVariant, model.Settings, builder);

                    model.ProcessVariant = HiddenStringFieldUpdateProcessVariant.None;
                    yield return(DefinitionTemplate(model));
                }
            }
            else
            {
                yield break;
            }
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (!builder.FieldType.Equals(typeof(MoneyField).Name))
            {
                yield break;
            }

            var model = new MoneyFieldSettings();

            if (updateModel.TryUpdateModel(model, typeof(MoneyFieldSettings).Name, null, null))
            {
                if (string.IsNullOrEmpty(model.DefaultCurrency))
                {
                    builder.WithSetting("MoneyFieldSettings.DefaultCurrency", Currency.FromCurrentCulture().Iso3LetterCode);
                }
                else
                {
                    Currency parsedCurrency;
                    if (Currency.TryParse(model.DefaultCurrency, out parsedCurrency))
                    {
                        builder.WithSetting("MoneyFieldSettings.DefaultCurrency", model.DefaultCurrency);
                    }
                    else
                    {
                        updateModel.AddModelError("InvalidCurrencyIsoCode", T("MoneyField - Invalid currency iso code was given."));
                    }
                }

                builder.WithSetting("MoneyFieldSettings.IsCurrencyReadOnly", model.IsCurrencyReadOnly.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("MoneyFieldSettings.Hint", model.Hint);
                builder.WithSetting("MoneyFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));
            }
            yield return(DefinitionTemplate(model));
        }
Example #5
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new ChoiceListFieldSettings();

            if (updateModel.TryUpdateModel(model, "ChoiceListFieldSettings", null, null))
            {
                builder.WithSetting("ChoiceListFieldSettings.Options", model.Options);
                builder.WithSetting("ChoiceListFieldSettings.ListMode", model.ListMode);
            }

            yield return(DefinitionTemplate(model));
        }
Example #6
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "JsonDataTableField")
            {
                yield break;
            }
            var model = new JsonDataTableFieldSettings();

            if (updateModel.TryUpdateModel(model, "JsonDataTableFieldSettings", null, null))
            {
                builder.WithSetting("JsonDataTableFieldSettings.ColumnsDefinition", model.ColumnsDefinition);
                builder.WithSetting("JsonDataTableFieldSettings.MaxRows", model.MaxRows.ToString());
            }
            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new ColorPickerFieldSettings();

            if (builder.FieldType != "ColorPickerField")
            {
                yield break;
            }
            if (updateModel.TryUpdateModel(model, "ColorPickerFieldSettings", null, null))
            {
                builder.WithSetting("ColorPickerFieldSettings.Hint", model.Hint);
                builder.WithSetting("ColorPickerFieldSettings.Options", model.Options);
            }
            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "HtmlBlockField")
            {
                yield break;
            }

            var model = new HtmlBlockFieldSettings();

            if (updateModel.TryUpdateModel(model, "HtmlBlockFieldSettings", null, null))
            {
                builder.WithSetting("HtmlBlockFieldSettings.Height", model.Height.ToString());
                builder.WithSetting("HtmlBlockFieldSettings.Helptext", model.HelpText);
            }
            yield return(DefinitionTemplate(model));
        }
 public static void SetValues(ContentPartFieldDefinitionBuilder builder, GDPRPartFieldSettings settings)
 {
     builder.WithSetting(
         "GDPRPartFieldSettings.ShouldAnonymize",
         settings.ShouldAnonymize.ToString(CultureInfo.InvariantCulture));
     builder.WithSetting(
         "GDPRPartFieldSettings.ShouldErase",
         settings.ShouldErase.ToString(CultureInfo.InvariantCulture));
     // serialized dictionaries
     builder.WithSetting(
         "GDPRPartFieldSettings.AnonymizationSerializedPairs",
         settings.AnonymizationSerializedPairs);
     builder.WithSetting(
         "GDPRPartFieldSettings.ErasureSerializedPairs",
         settings.ErasureSerializedPairs);
 }
Example #10
0
        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());
            }
        }
Example #11
0
        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);
            }
        }
Example #12
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "DateRangeField")
            {
                yield break;
            }

            var model = new DateRangeFieldSettings();

            if (updateModel.TryUpdateModel(model, "DateRangeFieldSettings", null, null))
            {
                builder.WithSetting("DateRangeFieldSettings.Hint", model.Hint);
                builder.WithSetting("DateRangeFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));

                yield return(DefinitionTemplate(model));
            }
        }
Example #13
0
        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());
            }
        }
Example #14
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "ContentPickerField")
            {
                yield break;
            }

            var model = new ContentPickerFieldExtensionSettings();

            if (updateModel.TryUpdateModel(model, "ContentPickerFieldExtensionSettings", null, null))
            {
                builder.WithSetting("ContentPickerFieldExtensionSettings.CascadePublish", model.CascadePublish.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("ContentPickerFieldExtensionSettings.SummaryView", model.SummaryView);
                builder.WithSetting("ContentPickerFieldExtensionSettings.PreviewSelected", model.PreviewSelected);
            }
            yield return(DefinitionTemplate(model));
        }
Example #15
0
        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());
            }
        }
Example #16
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "ContentPickerField")
            {
                yield break;
            }

            var model = new ContentPickerSearchFieldSettings();

            if (updateModel.TryUpdateModel(model, "ContentPickerSearchFieldSettings", null, null))
            {
                builder.WithSetting("ContentPickerSearchFieldSettings.ShowSearchTab", model.ShowSearchTab.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("ContentPickerSearchFieldSettings.SearchIndex", model.SearchIndex);
                builder.WithSetting("ContentPickerSearchFieldSettings.DisplayedContentTypes", model.DisplayedContentTypes);
            }

            yield return(DefinitionTemplate(model));
        }
Example #17
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "MediaLibraryPickerField")
            {
                yield break;
            }

            var model = new MediaLibraryPickerFieldLocalizationSettings();

            if (updateModel.TryUpdateModel(model, "MediaLibraryPickerFieldLocalizationSettings", null, null))
            {
                builder.WithSetting("MediaLibraryPickerFieldLocalizationSettings.TryToLocalizeMedia", model.TryToLocalizeMedia.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("MediaLibraryPickerFieldLocalizationSettings.RemoveItemsWithoutLocalization", model.RemoveItemsWithoutLocalization.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("MediaLibraryPickerFieldLocalizationSettings.RemoveItemsWithNoLocalizationPart", model.RemoveItemsWithNoLocalizationPart.ToString(CultureInfo.InvariantCulture));
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "MediaLibraryPickerField")
            {
                yield break;
            }

            var model = new MediaLibraryPickerFieldSettings();

            if (updateModel.TryUpdateModel(model, "MediaLibraryPickerFieldSettings", null, null))
            {
                builder.WithSetting("MediaLibraryPickerFieldSettings.Hint", model.Hint);
                builder.WithSetting("MediaLibraryPickerFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("MediaLibraryPickerFieldSettings.Multiple", model.Multiple.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("MediaLibraryPickerFieldSettings.DisplayedContentTypes", model.DisplayedContentTypes);
            }

            yield return(DefinitionTemplate(model));
        }
Example #19
0
        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));
            }
        }
Example #20
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "InsertStuffField")
            {
                yield break;
            }

            var model = new InsertStuffFieldSettings();

            if (updateModel.TryUpdateModel(model, "InsertStuffFieldSettings", null, null))
            {
                builder.WithSetting("InsertStuffFieldSettings.StyleList", model.StyleList);
                builder.WithSetting("InsertStuffFieldSettings.ScriptList", model.ScriptList);
                builder.WithSetting("InsertStuffFieldSettings.RawHtml", model.RawHtml);
                builder.WithSetting("InsertStuffFieldSettings.OnFooter", (model.OnFooter ? "true" : "false"));
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "ImageMultiPickerField")
            {
                yield break;
            }

            var model = new ImageMultiPickerFieldSettings();

            if (updateModel.TryUpdateModel(model, "ImageMultiPickerFieldSettings", null, null))
            {
                builder.WithSetting("ImageMultiPickerFieldSettings.ShowInAdminList", model.ShowInAdminList.ToString());
                builder.WithSetting("ImageMultiPickerFieldSettings.Hint", model.Hint);
                builder.WithSetting("ImageMultiPickerFieldSettings.CustomFields", model.CustomFields);
                builder.WithSetting("ImageMultiPickerFieldSettings.PreviewWidth", model.PreviewWidth.ToString(CultureInfo.InvariantCulture));
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "HashedStringField")
            {
                yield break;
            }

            var model = new HashedStringFieldSettings();

            if (updateModel.TryUpdateModel(model, "HashedStringFieldSettings", null, null))
            {
                builder.WithSetting("HashedStringFieldSettings.Hint", model.Hint);
                builder.WithSetting("HashedStringFieldSettings.Required", model.Required.ToString());
                builder.WithSetting("HashedStringFieldSettings.Pattern", model.Pattern);
                builder.WithSetting("HashedStringFieldSettings.ConfirmRequired", model.ConfirmRequired.ToString());
            }

            yield return(DefinitionTemplate(model));
        }
Example #23
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "JsonField")
            {
                yield break;
            }

            var model = new JsonFieldSettings();

            if (updateModel.TryUpdateModel(model, "JsonFieldSettings", null, null))
            {
                builder.WithSetting("JsonFieldSettings.Hint", model.Hint);
                builder.WithSetting("JsonFieldSettings.Template", model.Template);
                builder.WithSetting("JsonFieldSettings.UpdateValuesOnly", model.UpdateValuesOnly.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("JsonFieldSettings.CanEditJsonText", model.CanEditJsonText.ToString(CultureInfo.InvariantCulture));
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "DateTimeField")
            {
                yield break;
            }

            var model = new DateTimeFieldSettings();

            if (updateModel.TryUpdateModel(model, "DateTimeFieldSettings", null, null))
            {
                builder.WithSetting("DateTimeFieldSettings.Display", model.Display.ToString());
                builder.WithSetting("DateTimeFieldSettings.Hint", model.Hint);
                builder.WithSetting("DateTimeFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));
                model.DefaultValue = model.Editor == null ? model.DefaultValue : _dateLocalizationServices.ConvertFromLocalizedString(model.Editor.Date, model.Editor.Time);
                builder.WithSetting("DateTimeFieldSettings.DefaultValue", model.DefaultValue.HasValue ? model.DefaultValue.Value.ToString(CultureInfo.InvariantCulture) : String.Empty);

                yield return(DefinitionTemplate(model));
            }
        }
Example #25
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new FieldIndexing();

            updateModel.TryUpdateModel(model, "FieldIndexing", null, null);
            builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null);

            CreateIndexingTasks();

            yield return(DefinitionTemplate(model));
        }
Example #26
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new DateTimeFieldSettings();

            if (updateModel.TryUpdateModel(model, "DateTimeFieldSettings", null, null))
            {
                builder.WithSetting("DateTimeFieldSettings.Display", model.Display.ToString());
            }

            yield return(DefinitionTemplate(model));
        }
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "EnumerationField")
            {
                yield break;
            }

            var model = new EnumerationFieldSettings();

            if (updateModel.TryUpdateModel(model, "EnumerationFieldSettings", null, null))
            {
                builder.WithSetting("EnumerationFieldSettings.Hint", model.Hint);
                builder.WithSetting("EnumerationFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("EnumerationFieldSettings.Options", model.Options);
                builder.WithSetting("EnumerationFieldSettings.ListMode", model.ListMode.ToString());
                builder.WithSetting("EnumerationFieldSettings.DefaultValue", model.DefaultValue);
            }

            yield return(DefinitionTemplate(model));
        }
Example #28
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "NumericField")
            {
                yield break;
            }

            var model = new NumericFieldSettings();

            if (updateModel.TryUpdateModel(model, "NumericFieldSettings", null, null))
            {
                builder.WithSetting("NumericFieldSettings.Hint", model.Hint);
                builder.WithSetting("NumericFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("NumericFieldSettings.Scale", model.Scale.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("NumericFieldSettings.Minimum", model.Minimum.HasValue ? model.Minimum.Value.ToString(CultureInfo.InvariantCulture) : string.Empty);
                builder.WithSetting("NumericFieldSettings.Maximum", model.Maximum.HasValue ? model.Maximum.Value.ToString(CultureInfo.InvariantCulture) : string.Empty);
            }

            yield return(DefinitionTemplate(model));
        }
Example #29
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "TextField")
            {
                yield break;
            }

            var model = new TextFieldSettingsEventsViewModel {
                Settings = new TextFieldSettings()
            };

            if (updateModel.TryUpdateModel(model, "TextFieldSettingsEventsViewModel", null, null))
            {
                builder.WithSetting("TextFieldSettings.Flavor", model.Settings.Flavor);
                builder.WithSetting("TextFieldSettings.Hint", model.Settings.Hint);
                builder.WithSetting("TextFieldSettings.Required", model.Settings.Required.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("TextFieldSettings.DefaultValue", model.Settings.DefaultValue);

                yield return(DefinitionTemplate(model));
            }
        }
Example #30
0
 public static void SetValues(
     ContentPartFieldDefinitionBuilder builder,
     MediaLibraryPickerFieldGDPRPartFieldSettings settings)
 {
     // anonymization settings
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.AttemptToAnonymizeItems",
         settings.AttemptToAnonymizeItems.ToString(CultureInfo.InvariantCulture));
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.DetachGDPRItemsOnAnonymize",
         settings.DetachGDPRItemsOnAnonymize.ToString(CultureInfo.InvariantCulture));
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.DetachAllItemsOnAnonymize",
         settings.DetachAllItemsOnAnonymize.ToString(CultureInfo.InvariantCulture));
     // erasure settings
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.AttemptToEraseItems",
         settings.AttemptToEraseItems.ToString(CultureInfo.InvariantCulture));
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.DetachGDPRItemsOnErase",
         settings.DetachGDPRItemsOnErase.ToString(CultureInfo.InvariantCulture));
     builder.WithSetting(
         "MediaLibraryPickerFieldGDPRPartFieldSettings.DetachAllItemsOnErase",
         settings.DetachAllItemsOnErase.ToString(CultureInfo.InvariantCulture));
 }