using System; using System.Collections.Generic; using System.Linq; using System.Web; /// /// Summary description for OmaTehas /// /// namespace Tehased { public class OmaTehas : IHttpHandlerFactory { public OmaTehas() { // // TODO: Add constructor logic here // } #region IHttpHandlerFactory Members public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { IHttpHandler ohjur; string[] p = context.Request.Path.ToLower().Split('/'); if (p[p.Length - 1] == "oma.inf") ohjur = new Ohjurid.OmaOhjur(); else if (p[p.Length - 1] == "sala.inf") ohjur = new Ohjurid.SalajaneOhjur(); else throw new HttpException(403, "Sinul pole siia asja!"); return ohjur; } public void ReleaseHandler(IHttpHandler handler) { } #endregion } }