public void Handle(MediaTypeRefreshedNotification notification)
 {
     const ContentTypeChangeTypes types // only for those that have been refreshed
         = ContentTypeChangeTypes.RefreshMain | ContentTypeChangeTypes.RefreshOther;
     var mediaTypeIds = notification.Changes.Where(x => x.ChangeTypes.HasTypesAny(types)).Select(x => x.Item.Id)
         .ToArray();
     if (mediaTypeIds.Any())
     {
         _publishedSnapshotService.Rebuild(mediaTypeIds: mediaTypeIds);
     }
 }
 public JsonPayload(string itemType, int id, ContentTypeChangeTypes changeTypes)
 {
     ItemType    = itemType;
     Id          = id;
     ChangeTypes = changeTypes;
 }
        // ensures changes contains no duplicates
        private static void AddChange(ICollection <ContentTypeChange <TItem> > changes, TItem contentType, ContentTypeChangeTypes changeTypes)
        {
            var change = changes.FirstOrDefault(x => x.Item == contentType);

            if (change == null)
            {
                changes.Add(new ContentTypeChange <TItem>(contentType, changeTypes));
                return;
            }
            change.ChangeTypes |= changeTypes;
        }
 public ContentTypeChange(TItem item, ContentTypeChangeTypes changeTypes)
 {
     Item        = item;
     ChangeTypes = changeTypes;
 }
Esempio n. 5
0
 public static bool HasTypesNone(this ContentTypeChangeTypes change, ContentTypeChangeTypes types)
 {
     return((change & types) == ContentTypeChangeTypes.None);
 }
Esempio n. 6
0
 public static bool HasTypesAll(this ContentTypeChangeTypes change, ContentTypeChangeTypes types)
 {
     return((change & types) == types);
 }
Esempio n. 7
0
 public static bool HasType(this ContentTypeChangeTypes change, ContentTypeChangeTypes type) =>
 (change & type) != ContentTypeChangeTypes.None;