﻿using System.Web.Mvc;
using Hardcore.ApplicationModel;

namespace Hardcore.Web.Mvc
{
    class PageBackExceptionHandlingBlock : BlockComponent
    {
        private ControllerExceptionHandler _handlerFilter;

        public override void Initialize()
        {
            base.Initialize();

            _handlerFilter = new ControllerExceptionHandler();
            GlobalFilters.Filters.Add(_handlerFilter);
        }

        public override void Release()
        {
            GlobalFilters.Filters.Remove(_handlerFilter);

            base.Release();
        }
    }
}
