Exemplo n.º 1
0
        private void HandleLifecycleMethod(MethodDeclarationSyntax methodDeclaration, WebFormsAppLifecycleEvent lifecycleEvent)
        {
            var statements       = methodDeclaration.Body.Statements;
            var lambdaExpression = LifecycleManagerService.ContentIsPreHandle(lifecycleEvent) ?
                                   MiddlewareSyntaxHelper.ConstructMiddlewareLambda(preHandleStatements: statements) :
                                   MiddlewareSyntaxHelper.ConstructMiddlewareLambda(postHandleStatements: statements);

            _lifecycleManager.RegisterMiddlewareLambda(lifecycleEvent, lambdaExpression);
        }
Exemplo n.º 2
0
 public void ContentIsPreHandle_Returns_False_For_Last_Post_Handle_Events()
 {
     Assert.False(LifecycleManagerService.ContentIsPreHandle(WebFormsAppLifecycleEvent.PreSendRequestContent));
 }
Exemplo n.º 3
0
 public void ContentIsPreHandle_Returns_True_For_Last_Pre_Handle_Events()
 {
     Assert.True(LifecycleManagerService.ContentIsPreHandle(WebFormsAppLifecycleEvent.PreRequestHandlerExecute));
 }
Exemplo n.º 4
0
 public void ContentIsPreHandle_Returns_False_For_First_Post_Handle_Events()
 {
     Assert.False(LifecycleManagerService.ContentIsPreHandle(WebFormsAppLifecycleEvent.PostRequestHandlerExecute));
 }
Exemplo n.º 5
0
 public void ContentIsPreHandle_Returns_True_For_First_Pre_Handle_Events()
 {
     Assert.True(LifecycleManagerService.ContentIsPreHandle(WebFormsAppLifecycleEvent.BeginRequest));
 }