예제 #1
0
        internal static string SerializeIds(this ContentPickerField picker)
        {
            if (picker == null)
            {
                return(String.Empty);
            }

            return(picker.Ids.SerializeIds());
        }
예제 #2
0
        internal static IEnumerable <T> GetPickedContentAs <T>(this ContentPickerField picker) where T : IContent
        {
            if (picker != null && picker.ContentItems != null && picker.ContentItems.Any())
            {
                return(picker.ContentItems.Select(item => item.As <T>()).Where(t => t != null));
            }

            return(Enumerable.Empty <T>());
        }
예제 #3
0
 protected override DriverResult Editor(ContentPart part, ContentPickerField field, IUpdateModel updater, dynamic shapeHelper)
 {
     return(Editor(part, field, shapeHelper));
 }
예제 #4
0
 private ContentPickerFieldGDPRPartFieldSettings Setting(ContentPickerField field) {
     return field.PartFieldDefinition.Settings.GetModel<ContentPickerFieldGDPRPartFieldSettings>();
 }
예제 #5
0
 private bool ShoulDetachAll(GDPRContentContext context, ContentPickerField field) {
     return context.Erase
         ? Setting(field).DetachAllItemsOnErase
         : Setting(field).DetachAllItemsOnAnonymize;
 }
예제 #6
0
 private int[] RemainingIds(ContentPickerField field, Func<ContentItem, bool> shouldRemain) {
     var items = _contentManager.GetMany<ContentItem>(field.Ids, VersionOptions.AllVersions, QueryHints.Empty);
     return items.Where(shouldRemain).Select(ci => ci.Id).Distinct().ToArray();
 }
예제 #7
0
 private bool CheckFlag(GDPRContentContext context, ContentPickerField fi) {
     var settings = fi.PartFieldDefinition.Settings.GetModel<ContentPickerFieldGDPRPartFieldSettings>();
     return context.Erase ?
         settings.AttemptToEraseItems :
         settings.AttemptToAnonymizeItems;
 }
 protected override void Cloning(ContentPart part, ContentPickerField originalField, ContentPickerField cloneField, CloneContentContext context)
 {
     cloneField.Ids = originalField.Ids;
 }