public Delegate getController(URI uri) { if (uri.Route[uri.Route.Length - 1] == '/') { uri.Route = uri.Route.Remove(uri.Route.Length - 1); } try { return(controllers[uri]); } catch (Exception e) { return(controllers[new URI("no", "controller")]); } }
public void addController(URI uri, Delegate controller) { controllers.Add(uri, controller); }
protected bool Equals(URI other) { return(string.Equals(Route, other.Route) && string.Equals(Method, other.Method)); }