Ejemplo n.º 1
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     context.Result = new ContentResult
     {
         Content = "The Result was never executed"
     };
 }
Ejemplo n.º 2
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            // Should only run on a full view rendering result
            if (!(filterContext.Result is ViewResult))
            {
                return;
            }

            // Should only run on the Admin
            if (!AdminAttribute.IsApplied(filterContext.HttpContext))
            {
                return;
            }

            // Populate main nav
            IShape menuShape = _shapeFactory.Create("Menu", 
                Arguments.From(new
                {
                    MenuName = "admin",
                    RouteData = filterContext.RouteData,
                }));

            // Enable shape caching
            menuShape.Metadata
                .Cache("menu-admin")
                .AddContext("user.roles")
                .AddDependency("features")
                .AddDependency("types") // This should go in a Displaying Shape event in the Contents module
                ;

            _layoutAccessor.GetLayout().Navigation.Add(menuShape);
            
        }
Ejemplo n.º 3
0
        public override void OnResultExecuting(ResultExecutingContext context)
        {
            context.HttpContext.Response.Headers["Cache-Control"] = "no-cache, no-store, max-age=0";
            context.HttpContext.Response.Headers["Pragma"] = "no-cache";
            context.HttpContext.Response.Headers["Expires"] = "-1";

            base.OnResultExecuting(context);
        }
Ejemplo n.º 4
0
            public void OnResultExecuting(ResultExecutingContext context)
            {
                var options = context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>();
                var jsonFormatter = options.Value.OutputFormatters.OfType<JsonOutputFormatter>().Single();

                // Update the output formatter collection to only return JSON. 
                var result = (ObjectResult)context.Result;
                result.Formatters.Add(jsonFormatter);
            }
 public void OnResultExecuting(ResultExecutingContext context)
 {
     var objectResult = context.Result as ObjectResult;
     if (objectResult != null)
     {
         objectResult.Formatters.RemoveType<JsonOutputFormatter>();
         objectResult.Formatters.Add(new JsonOutputFormatter(_serializerSettings));
     }
 }
Ejemplo n.º 6
0
 private async Task HandleCommandResponse(ResultExecutingContext context)
 {
     var url = context.Controller.GetType() +"|"+ context.ActionDescriptor.DisplayName;
     if (context.HttpContext.Response.StatusCode == 200)
     {
         _logger.LogWarning($"Invalidating ({url})");
         await _store.Invalidate(url);
     }
 }
        public override void OnResultExecuting(ResultExecutingContext context)
        {
            var objResult = context.Result as ObjectResult;
            var dummyClass = objResult.Value as DummyClass;
            dummyClass.SampleInt = 120;

            objResult.Formatters.Add(new XmlSerializerOutputFormatter());

            base.OnResultExecuting(context);
        }
Ejemplo n.º 8
0
 public override async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
 {
     if (context.HttpContext.Request.Method == "GET")
     {
         await HandleQueryResponse(context);
     }
     else
     {
         await HandleCommandResponse(context);
     }
     await next();
 }
        public void ResultProperty()
        {
            // Arrange
            ControllerContext controllerContext = new Mock<ControllerContext>().Object;
            ActionResult result = new ViewResult();

            // Act
            ResultExecutingContext resultExecutingContext = new ResultExecutingContext(controllerContext, result);

            // Assert
            Assert.Equal(result, resultExecutingContext.Result);
        }
Ejemplo n.º 10
0
            public void OnResultExecuting(ResultExecutingContext context)
            {
                var viewResult = context.Result as ViewResult;

                if (viewResult != null)
                {
                    var user = viewResult.ViewData.Model as User;

                    if (user != null)
                    {
                        user.Name += "**" + user.Name + "**";
                    }
                }
            }
        public override Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
        {
            var objectResult = context?.Result as ObjectResult;

            if (objectResult != null)
            {
                var queryContext = context.HttpContext.Items[Constants.QueryContextPropertyName] as QueryContext;
                var resourceResult = ResultPreprocessor.PreprocessResult(objectResult.Value, this.Resource, queryContext);

                objectResult.Value = resourceResult;
                objectResult.DeclaredType = typeof(ResourceResult);
            }

            return base.OnResultExecutionAsync(context, next);
        }
Ejemplo n.º 12
0
        private async Task HandleQueryResponse(ResultExecutingContext context)
        {
            if (context.Result.GetType() != typeof (Microsoft.AspNet.Mvc.ObjectResult))
                return;

            var url = context.Controller.GetType() + "|" + context.ActionDescriptor.DisplayName;
            _logger.LogWarning("No cache entry found, invoke next");
            //add response body to the store
            if (context.HttpContext.Response.StatusCode == 200)
            {
                var jsonResponse = Newtonsoft.Json.JsonConvert.SerializeObject(((Microsoft.AspNet.Mvc.ObjectResult)context.Result).Value);
                await _store.Set(url, jsonResponse, DateTime.Now.AddHours(1));
            }
            else
            {
                _logger.LogWarning($"Entry not cached, content type: ({context.HttpContext.Response.ContentType}), response code: ({context.HttpContext.Response.StatusCode})");
            }
        }
Ejemplo n.º 13
0
        public override void OnResultExecuting(ResultExecutingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            base.OnResultExecuting(context);
            var objectResult = context.Result as ObjectResult;

            if (objectResult != null)
            {
                // Check if there are any IFormatFilter in the pipeline, and if any of them is active. If there is one,
                // do not override the content type value.
                if (context.Filters.OfType<IFormatFilter>().All(f => !f.IsActive))
                {
                    SetContentTypes(objectResult.ContentTypes);
                }
            }
        }
Ejemplo n.º 14
0
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var filter=filterContext.Filters.Where(t => t.GetType() == typeof(ResponseCacheFilter)).FirstOrDefault();
            if (filter != null)
            {
                ResponseCacheFilter f = (ResponseCacheFilter)filter;
                f.NoStore = true;
                //f.Duration = 0;
            }
            else
            {
                //Not allowed
                //filterContext.Filters.Add(new ResponseCacheAttribute() { NoStore=true} );
            }
            //For older MVC
            //Microsoft.AspNet.Mvc.ResponseCacheAttribute()
            //filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
            //filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false);
            //filterContext.HttpContext.Response.Cache.SetRevalidation(System.Web.HttpCacheRevalidation.AllCaches);
            //filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            //filterContext.HttpContext.Response.Cache.SetNoStore();

            base.OnResultExecuting(filterContext);
        }
Ejemplo n.º 15
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var viewResult = filterContext.Result as ViewResultBase;
            var ajaxResult = filterContext.Result as AjaxResult;

            if (viewResult == null && ajaxResult == null)
            {
                return;
            }

            var messages = Convert.ToString(filterContext.Controller.TempData[TempDataMessages]);

            if (string.IsNullOrEmpty(messages))
            {
                return;
            }

            var messageEntries = new List <NotifyEntry>();

            foreach (var line in messages.Split(new[] { System.Environment.NewLine + "-" + System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
            {
                var delimiterIndex = line.IndexOf(':');
                if (delimiterIndex != -1)
                {
                    var type    = (NotifyType)Enum.Parse(typeof(NotifyType), line.Substring(0, delimiterIndex));
                    var message = line.Substring(delimiterIndex + 1);
                    if (messageEntries.All(ne => ne.Message != message))
                    {
                        messageEntries.Add(new NotifyEntry
                        {
                            Type    = type,
                            Message = message
                        });
                    }
                }
                else
                {
                    var message = line.Substring(delimiterIndex + 1);
                    if (messageEntries.All(ne => ne.Message != message))
                    {
                        messageEntries.Add(new NotifyEntry
                        {
                            Type    = NotifyType.Info,
                            Message = message
                        });
                    }
                }
            }

            if (!messageEntries.Any())
            {
                return;
            }

            if (ajaxResult != null)
            {
                foreach (var messageEntry in messageEntries)
                {
                    switch (messageEntry.Type)
                    {
                    case NotifyType.Info:
                        ajaxResult.NotifyMessage("NOTIFY_INFO", new { messageEntry.Message });
                        break;

                    case NotifyType.Warning:
                        ajaxResult.NotifyMessage("NOTIFY_WARNING", new { messageEntry.Message });
                        break;

                    case NotifyType.Error:
                        ajaxResult.NotifyMessage("NOTIFY_ERROR", new { messageEntry.Message });
                        break;
                    }
                }
            }
            else
            {
                var messagesZone = workContextAccessor.GetContext(filterContext).Layout.Zones["Messages"];
                foreach (var messageEntry in messageEntries)
                {
                    messagesZone = messagesZone.Add(shapeFactory.Message(messageEntry));
                }
            }
        }
        public async Task ResultIsTranslatedAsync()
        {
            var decoratedProducerId1 = Translator.Decorate(Foo.IdConceptName, Foo.ProducerName, Foo.ProducerId1);
            // Mock a translator
            var testServiceMock = new Mock <ITranslatorService>();

            testServiceMock
            .Setup(service => service.TranslateAsync(It.IsAny <IEnumerable <string> >(), It.IsAny <string>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(() => new Dictionary <string, string> {
                { decoratedProducerId1, Foo.ConsumerId1 }
            });

            // Prepare context
            var foosController = new FoosController();
            var foo            = new Foo
            {
                Id   = decoratedProducerId1,
                Name = "name"
            };

#if NETCOREAPP
            var controllerActionDescriptor = new ControllerActionDescriptor
            {
                MethodInfo = foosController.GetType().GetMethod(nameof(foosController.UpdateAndReturnAsync))
            };
            var actionContext = new ActionContext
            {
                HttpContext      = new DefaultHttpContext(),
                RouteData        = new RouteData(),
                ActionDescriptor = controllerActionDescriptor
            };
            var executingContext = new ResultExecutingContext(actionContext, new List <IFilterMetadata>(), new ObjectResult(foo), foosController);
#else
            var contextMock = CreateExecutedContextWithStatusCode(HttpStatusCode.OK, foo);
#endif

            // Setup the filter
            var filter = new ValueTranslatorFilter(testServiceMock.Object, () => Foo.ConsumerName);

            // Run the filter
#if NETCOREAPP
            await filter.OnResultExecutionAsync(executingContext, () => Task.FromResult(new ResultExecutedContext(actionContext, new List <IFilterMetadata>(), executingContext.Result, foosController)));
#else
            await filter.OnActionExecutedAsync(contextMock, new CancellationToken());
#endif

#if NETCOREAPP
            var objectResult = executingContext.Result as ObjectResult;
#else
            var objectResult = contextMock.Response.Content.AsString();
#endif

            // Verify that the result has been translated
            Assert.IsNotNull(objectResult);
#if NETCOREAPP
            var outFoo = objectResult.Value as Foo;
            if (outFoo == null && objectResult.Value is JObject jObject)
            {
                outFoo = jObject.ToObject <Foo>();
            }
#else
            var outFoo = JsonConvert.DeserializeObject <Foo>(objectResult);
#endif
            Assert.IsNotNull(outFoo);
            Assert.AreEqual(Foo.ConsumerId1, outFoo.Id);
        }
Ejemplo n.º 17
0
 public void OnResultExecuting(ResultExecutingContext context)
 {
     context.HttpContext.Response.Headers.Add(
         "OnResultExecuting",
         "This header was added by result filter.");
 }
Ejemplo n.º 18
0
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
     base.OnResultExecuting(filterContext);
 }
Ejemplo n.º 19
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     context.HttpContext.Response.Headers.Add(_name, new string[] { _value });
     base.OnResultExecuting(context);
 }
Ejemplo n.º 20
0
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
     Console.WriteLine("Result执行之前!");
 }
Ejemplo n.º 21
0
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
     //filterContext.HttpContext.Session["AdminUser"] += "TestFilter OnResultExecuting<br/>";
 }
Ejemplo n.º 22
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     LogRequest("Result Executing", context.RouteData);
 }
Ejemplo n.º 23
0
 /// <inheritdoc />
 void IResultFilter.OnResultExecuting(ResultExecutingContext context) => Produces.OnResultExecuting(context);
Ejemplo n.º 24
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var viewResult = filterContext.Result as ViewResultBase;

            // if it's not a view result, a redirect for example
            if (viewResult == null)
            {
                return;
            }

            var messages = Convert.ToString(viewResult.TempData[TempDataMessages]);

            if (string.IsNullOrEmpty(messages))
            {
                return;// nothing to do, really
            }

            var messageEntries = new List <NotifyEntry>();

            foreach (var line in messages.Split(new[] { System.Environment.NewLine + "-" + System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
            {
                var delimiterIndex = line.IndexOf(':');
                if (delimiterIndex != -1)
                {
                    var    type    = Kore.EnumExtensions.Parse <NotifyType>(line.Substring(0, delimiterIndex));
                    string message = line.Substring(delimiterIndex + 1);
                    if (!messageEntries.Any(ne => ne.Message == message))
                    {
                        messageEntries.Add(new NotifyEntry
                        {
                            Type    = type,
                            Message = message
                        });
                    }
                }
                else
                {
                    string message = line.Substring(delimiterIndex + 1);
                    if (!messageEntries.Any(ne => ne.Message == message))
                    {
                        messageEntries.Add(new NotifyEntry
                        {
                            Type    = NotifyType.Info,
                            Message = message
                        });
                    }
                }
            }

            if (!messageEntries.Any())
            {
                return;
            }

            var workContext = EngineContext.Current.Resolve <IWebWorkContext>();

            foreach (var messageEntry in messageEntries)
            {
                workContext.Notifications.Add(messageEntry);
            }
            //todo: (heskew) probably need to keep duplicate messages from being pushed into the zone like the previous behavior
            //baseViewModel.Messages = baseViewModel.Messages == null ? messageEntries .Messages.Union(messageEntries).ToList();
            //baseViewModel.Zones.AddRenderPartial("content:before", "Messages", baseViewModel.Messages);
        }
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     TryEnrichResult(context);
     base.OnResultExecuting(context);
 }
Ejemplo n.º 26
0
 /// <summary>Called before the action result executes.</summary>
 /// <param name="context">The <see cref="T:Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext" />.</param>
 public void OnResultExecuting(ResultExecutingContext context)
 {
     Stopwatch.Restart();
 }
Ejemplo n.º 27
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     WriteMessage(context, $"<div>Before Result:{message}</div>");
 }
Ejemplo n.º 28
0
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
     filterContext.HttpContext.Response.Write("<p>AA:OnResultExecuting</p>");
 }
Ejemplo n.º 29
0
 public virtual void OnResultExecuting(ResultExecutingContext filterContext)
 {
     // Intentionally left blank to allow for a better overriding experience
 }
        protected override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            ProcessOutputCache(filterContext);

            base.OnResultExecuting(filterContext);
        }
Ejemplo n.º 31
0
 /// <inheritdoc />
 public void OnResultExecuting(ResultExecutingContext context)
 {
 }
 /// <summary>Applies output cache as configured in the n2/host/outputCache config section.</summary>
 /// <param name="filterContext"></param>
 protected virtual void ProcessOutputCache(ResultExecutingContext filterContext)
 {
     new ContentOutputCacheAttribute(true).OnResultExecuting(filterContext);
 }
        private async Task<ResultExecutedContext> InvokeActionResultFilterRecursiveAsync(IList<IResultFilter> filters, int filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
        {
            // Performance-sensitive

            // For compatbility, the following behavior must be maintained
            //   The OnResultExecuting events must fire in forward order
            //   The InvokeActionResultAsync must then fire
            //   The OnResultExecuted events must fire in reverse order
            //   Earlier filters can process the results and exceptions from the handling of later filters
            // This is achieved by calling recursively and moving through the filter list forwards

            // If there are no more filters to recurse over, create the main result
            if (filterIndex > filters.Count - 1)
            {
                await InvokeActionResultAsync(controllerContext, actionResult).ConfigureAwait(false);
                return new ResultExecutedContext(controllerContext, actionResult, canceled: false, exception: null);
            }

            // Otherwise process the filters recursively
            IResultFilter filter = filters[filterIndex];
            filter.OnResultExecuting(preContext);
            if (preContext.Cancel)
            {
                return new ResultExecutedContext(preContext, preContext.Result, canceled: true, exception: null);
            }

            bool wasError = false;
            ResultExecutedContext postContext = null;
            try
            {
                // Use the filters in forward direction
                int nextFilterIndex = filterIndex + 1;
                postContext = await InvokeActionResultFilterRecursiveAsync(filters, nextFilterIndex, preContext, controllerContext, actionResult).ConfigureAwait(false);
            }
            catch (ThreadAbortException)
            {
                // This type of exception occurs as a result of Response.Redirect(), but we special-case so that
                // the filters don't see this as an error.
                postContext = new ResultExecutedContext(preContext, preContext.Result, canceled: false, exception: null);
                filter.OnResultExecuted(postContext);
                throw;
            }
            catch (Exception ex)
            {
                wasError = true;
                postContext = new ResultExecutedContext(preContext, preContext.Result, canceled: false, exception: ex);
                filter.OnResultExecuted(postContext);
                if (!postContext.ExceptionHandled)
                {
                    throw;
                }
            }
            if (!wasError)
            {
                filter.OnResultExecuted(postContext);
            }
            return postContext;
        }
Ejemplo n.º 34
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     timer = Stopwatch.StartNew();
 }
Ejemplo n.º 35
0
        public override void OnResultExecuting(ResultExecutingContext context)
        {
            if (context.Result is ValidationFailedResult)
            {
                ObjectResult objectResult = context.Result as ObjectResult;
                context.Result = objectResult;
            }
            else
            {
                ObjectResult    objectResult = context.Result as ObjectResult;
                BaseResultModel model        = new BaseResultModel(code: objectResult.StatusCode == null ? 200 : objectResult.StatusCode, result: objectResult.Value);
                #region      返回状态码以及对应的IActionResult格式和原因
                //200 OK 用于一般性的成功返回,不可用于请求错误返回
                //201 Created 资源被创建
                //202 Accepted 用于资源异步处理的返回,仅表示请求已经收到。对于耗时比较久的处理,一般用异步处理来完成
                //204 No Content  此状态可能会出现在 PUT、POST、DELETE 的请求中,一般表示资源存在,但消息体中不会返回任何资源相关的状态或信息
                //400 Bad Request 用于客户端一般性错误信息返回, 在其它 4xx 错误以外的错误,也可以使用,错误信息一般置于 body 中
                //401 Unauthorized 接口需要授权访问,为通过授权验证
                //403 Forbidden 当前的资源被禁止访问
                //404 Not Found   找不到对应的信息
                //500 Internal Server Error 服务器内部错误
                #endregion
                switch (model.Code)
                {
                case 200:
                    model.Message = "返回成功";
                    break;

                case 201:
                    model.Message = "资源被创建!";
                    break;

                case 202:
                    model.Message = "用于资源异步处理的返回,仅表示请求已经收到。对于耗时比较久的处理,一般用异步处理来完成!";
                    break;

                case 204:
                    model.Message = "此状态可能会出现在 PUT、POST、DELETE 的请求中,一般表示资源存在,但消息体中不会返回任何资源相关的状态或信息!";
                    break;

                case 400:
                    model.Message = "用于客户端一般性错误信息返回, 在其它 4xx 错误以外的错误,也可以使用,错误信息一般置于 body 中!";
                    break;

                case 401:
                    model.Message = "接口需要授权访问,为通过授权验证!";
                    break;

                case 403:
                    model.Message = "当前的资源被禁止访问!";
                    break;

                case 404:
                    model.Message = "找不到对应的信息!";
                    break;

                case 500:
                    model.Message = "服务器内部错误!";
                    break;

                default:
                    break;
                }
                context.Result = new OkObjectResult(model);
            }
        }
 public new void OnResultExecuting(ResultExecutingContext filterContext)
 => base.OnResultExecuting(filterContext);
 public void OnResultExecuting(ResultExecutingContext context)
 {
     Console.WriteLine("Executing IAlwaysRunResultFilter.OnResultExecuting");
     //context.Cancel = true;
 }
Ejemplo n.º 38
0
 private static ResultExecutedContext CreateResultExecutedContext(ResultExecutingContext context)
 {
     return new ResultExecutedContext(context, context.Filters, context.Result, context.Controller);
 }
Ejemplo n.º 39
0
 private static ResultExecutedContext CreateResultExecutedContext(ResultExecutingContext context)
 {
     return(new ResultExecutedContext(context, context.Filters, context.Result));
 }
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
 }
Ejemplo n.º 41
0
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
     this.timer = Stopwatch.StartNew();
 }
        protected virtual Task<ResultExecutedContext> InvokeActionResultWithFiltersAsync(ControllerContext controllerContext, IList<IResultFilter> filters, ActionResult actionResult)
        {
            ResultExecutingContext preContext = new ResultExecutingContext(controllerContext, actionResult);

            int startingFilterIndex = 0;
            return InvokeActionResultFilterRecursiveAsync(filters, startingFilterIndex, preContext, controllerContext, actionResult);
        }
Ejemplo n.º 43
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="filterContext"></param>
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
     _viewdatetimenow = DateTime.Now;
     base.OnResultExecuting(filterContext);
 }
Ejemplo n.º 44
0
 public override void OnResultExecuting(ResultExecutingContext context)
 {
     _logger.LogInformation("OnResultExecuting");
     base.OnResultExecuting(context);
 }
Ejemplo n.º 45
0
 public void OnResultExecuting(ResultExecutingContext context)
 {
     _timer = Stopwatch.StartNew();
 }
Ejemplo n.º 46
0
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
     filterContext.HttpContext.Response.ContentType = ContentType;
 }
Ejemplo n.º 47
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            if ((filterContext.Result is ViewResult) || _shouldDeleteCookie)
            {
                _httpContextAccessor.HttpContext.Response.Cookies.Delete(CookiePrefix, new CookieOptions { Path = _tenantPath });
            }

            if (!(filterContext.Result is ViewResult))
            {
                return;
            }

            var messageEntries = _existingEntries ?? new List<NotifyEntry>();

            if (messageEntries.Count == 0)
            {
                return;
            }
             
            var messagesZone = _layoutAccessor.GetLayout().Zones["Messages"];
            foreach (var messageEntry in messageEntries)
            {
                messagesZone = messagesZone.Add(_shapeFactory.Message(messageEntry));
            }
        }
Ejemplo n.º 48
0
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
 }
Ejemplo n.º 49
0
 public void OnResultExecuting(ResultExecutingContext context)
 {
     context.Result = Helpers.GetContentResult(context.Result, "Controller Override");
 }
Ejemplo n.º 50
0
 /// <inheritdoc />
 public virtual void OnResultExecuting(ResultExecutingContext context)
 {
 }
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 52
0
        protected override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            SetSkinNames(User != null ? User.Identity.Name : "");

            base.OnResultExecuting(filterContext);
        }
Ejemplo n.º 53
0
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            MonitorLog MonLog = filterContext.Controller.ViewData[Key] as MonitorLog;

            MonLog.ResponseTime = DateTime.Now;
        }
Ejemplo n.º 54
0
 public void OnResultExecuting(ResultExecutingContext context)
 {
     context.HttpContext.Response.Headers.Append("filters", "Controller Override - OnResultExecuting");
 }
 public virtual void OnResultExecuting(ResultExecutingContext filterContext)
 {
 }
Ejemplo n.º 56
0
 public override void OnResultExecuting(ResultExecutingContext filterContext)
 {
     filterContext.Controller.ViewBag.SelectedTab = _selectedTab;
 }
 public void OnResultExecuting(ResultExecutingContext filterContext)
 {
     if (OnResultExecutingImpl != null)
     {
         OnResultExecutingImpl(filterContext);
     }
 }
Ejemplo n.º 58
0
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var controller = filterContext.Controller as Controller;

            controller.ViewBag.PageHelpFileName = _pageHelpFileName;
        }