Exemple #1
0
        /// <summary>
        /// Based on the type, emit's a specific event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal static void EmitEvent(HttpActionExecutedContext sender, EditorModelEventArgs e)
        {
            if (e.Model is ContentItemDisplay)
            {
                OnSendingContentModel(sender, new EditorModelEventArgs <ContentItemDisplay>(e));
            }

            if (e.Model is MediaItemDisplay)
            {
                OnSendingMediaModel(sender, new EditorModelEventArgs <MediaItemDisplay>(e));
            }

            if (e.Model is MemberDisplay)
            {
                OnSendingMemberModel(sender, new EditorModelEventArgs <MemberDisplay>(e));
            }

            if (e.Model is UserDisplay)
            {
                OnSendingUserModel(sender, new EditorModelEventArgs <UserDisplay>(e));
            }

            if (e.Model is IEnumerable <Tab <IDashboardSlim> > )
            {
                OnSendingDashboardModel(sender, new EditorModelEventArgs <IEnumerable <Tab <IDashboardSlim> > >(e));
            }
        }
        /// <summary>
        /// Based on the type, emit's a specific event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal static void EmitEvent(HttpActionExecutedContext sender, EditorModelEventArgs e)
        {
            var contentItemDisplay = e.Model as ContentItemDisplay;

            if (contentItemDisplay != null)
            {
                OnSendingContentModel(sender, new EditorModelEventArgs <ContentItemDisplay>(e));
            }

            var mediaItemDisplay = e.Model as MediaItemDisplay;

            if (mediaItemDisplay != null)
            {
                OnSendingMediaModel(sender, new EditorModelEventArgs <MediaItemDisplay>(e));
            }

            var memberItemDisplay = e.Model as MemberDisplay;

            if (memberItemDisplay != null)
            {
                OnSendingMemberModel(sender, new EditorModelEventArgs <MemberDisplay>(e));
            }

            var userDisplay = e.Model as UserDisplay;

            if (userDisplay != null)
            {
                OnSendingUserModel(sender, new EditorModelEventArgs <UserDisplay>(e));
            }
        }
        private static void OnSendingMemberModel(HttpActionExecutedContext sender, EditorModelEventArgs <MemberDisplay> e)
        {
            var handler = SendingMemberModel;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Exemple #4
0
        private static void OnSendingMemberModel(HttpActionExecutedContext sender, EditorModelEventArgs <MemberDisplay> e)
        {
            var handler = SendingMemberModel;

            handler?.Invoke(sender, e);
        }
Exemple #5
0
        private static void OnSendingDashboardModel(HttpActionExecutedContext sender, EditorModelEventArgs <IEnumerable <Tab <IDashboardSlim> > > e)
        {
            var handler = SendingDashboardSlimModel;

            handler?.Invoke(sender, e);
        }
 public EditorModelEventArgs(EditorModelEventArgs baseArgs)
     : base(baseArgs.Model, baseArgs.UmbracoContext)
 {
     Model = (T)baseArgs.Model;
 }