About

using System;
using System.Web;
using Baleinoid.KeepInTouch;

namespace Baleinoid.Blog
{
  public class AboutHttpHandler : IHttpHandler
  {
    Contact Me { get; private set; }

    public AboutHttpHandler()
    {
      Me = new Contact("whaly", "baleinoid.fr");
    }

    public void ProcessRequest(HttpContext context)
    {
      using (Contact you = new Contact(context.Request))
      {
        if (you.Know(Me))
          throw new Exception("you don't need more information");
        else if (you.WantToContact(Me) || you.NeedToContact(Me))
          you.SendMail(Me);
      }

      context.Response.Redirect("http://frederichusson.com");
    }

    public bool IsReusable
    {
        get { return true; }
    }
  }
}

Leave a Reply