コード例 #1
0
        protected JsonResult Do(WindowAction action)
        {
            if (Actions.OfType <NotificationAction>().Any())
            {
                if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action))
                {
                    NotificationAction.ScheduleForNextRequest(Actions);
                }
            }

            return(AddAction(new { BrowserAction = action.ToString() }));
        }
コード例 #2
0
ファイル: JavascriptActions.cs プロジェクト: tohfe/Olive
        public void Do(WindowAction action)
        {
            if (this.OfType <NotificationAction>().Any())
            {
                if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action))
                {
                    NotificationAction.ScheduleForNextRequest();
                }
            }

            Add(new { BrowserAction = action.ToString() });
        }
コード例 #3
0
ファイル: JavascriptActions.cs プロジェクト: tohfe/Olive
        public void Redirect(string url, bool withAjax = false, string target = null)
        {
            url = url.Or("#");
            if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:"))
            {
                url = "/" + url;
            }

            NotificationAction.ScheduleForNextRequest();

            Add(new { Redirect = url, WithAjax = withAjax, Target = target });
        }
コード例 #4
0
        public ActionResult AjaxRedirect(string url)
        {
            url = url.Or("#");
            if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:"))
            {
                url = "/" + url;
            }

            if (Actions.OfType <NotificationAction>().Any())
            {
                NotificationAction.ScheduleForNextRequest(Actions);
            }

            Actions.Add(new { Redirect = url, WithAjax = true });

            return(JsonActions());
        }
コード例 #5
0
        public ActionResult Redirect(string url, string target = null)
        {
            url = url.Or("#");
            if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:"))
            {
                url = "/" + url;
            }

            if (Actions.OfType <NotificationAction>().Any())
            {
                NotificationAction.ScheduleForNextRequest(Actions);
            }

            if (Request.IsAjaxCall() || target.HasValue())
            {
                Actions.Add(new { Redirect = url, Target = target });

                return(JsonActions());
            }
            else
            {
                return(base.Redirect(url));
            }
        }
コード例 #6
0
 /// <summary>
 /// Creates a ViewResult object by using the model that renders a view to the response.
 /// </summary>
 protected new internal async Task <ViewResult> View(string viewName, object model)
 {
     AddAction(await NotificationAction.GetScheduledNotification());
     return(base.View(viewName, model));
 }
コード例 #7
0
ファイル: JavascriptActions.cs プロジェクト: tohfe/Olive
 internal void ScheduleNotifications() => Add(NotificationAction.GetScheduledNotification());