NotificationsFrontendAfterSelectData Field |
Namespace: Dynamicweb.News
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.NewsV2.Frontend.AfterSelectData)] public class NewsV2AfterSelectDataObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args) { if (args == null || !(args is Dynamicweb.NewsV2.Extensibility.FrontendDataNotificationArgs)) return; Dynamicweb.NewsV2.Extensibility.FrontendDataNotificationArgs item = (Dynamicweb.NewsV2.Extensibility.FrontendDataNotificationArgs)args; if (item.Data == null || !(item.Data is Dynamicweb.NewsV2.NewsItemCollection)) return; Dynamicweb.NewsV2.NewsItemCollection list = (Dynamicweb.NewsV2.NewsItemCollection)item.Data; if (list.Count > 0) list.RemoveAt(0); // remove first news } }