public ISillyView Index(ISillyContext context) { Stopwatch timer2 = new Stopwatch(); Stopwatch timer3 = new Stopwatch(); timer3.Start(); Task <Document> data = base.DynamoGetItemAsync(Amazon.RegionEndpoint.USWest1, "sillywidgets", "*****@*****.**"); timer2.Start(); SillyView home = new SillyView(); SillyView content = new SillyView(); SillyView header = new SillyView(); Task <bool> result = home.LoadS3Async("sillywidgets.com", "diagnostic/diag.html", Amazon.RegionEndpoint.USWest1); Task <bool> result2 = content.LoadS3Async("sillywidgets.com", "diagnostic/content.html", Amazon.RegionEndpoint.USWest1); Task <bool> result3 = header.LoadS3Async("sillywidgets.com", "diagnostic/header.html", Amazon.RegionEndpoint.USWest1); data.Wait(); timer3.Stop(); result.Wait(); result2.Wait(); result3.Wait(); timer2.Stop(); home.Bind(data.Result); home.Bind("content", content); home.Bind("header", header); home.Bind("dynamoGetValue", timer3.Elapsed.TotalMilliseconds + "ms"); home.Bind("s3source", "diagnostic/diag.html"); home.Bind("loadViewValue", timer2.Elapsed.TotalMilliseconds + "ms"); return(home); }
public ISillyView D***o(ISillyContext context, object var, object var2) { ISillyView content = new SillyView(); content.Content = "<h1>Admin.D***o(v1, v2)</h1>"; return(content); }
public ISillyView Users(ISillyContext context, object var, object names) { ISillyView content = new SillyView(); content.Content = "<h1>Admin.Users(v1, v2)</h1>"; return(content); }
public ISillyView Dashboard(ISillyContext context) { ISillyView content = new SillyView(); content.Content = "<h1>Admin.Dashboard</h1>"; return(content); }
public ISillyView Index(ISillyContext context) { ISillyView content = new SillyView(); content.Content = "<h1>Admin.Index</h1>"; return(content); }
public ISillyView SexTaco(ISillyContext context) { ISillyView content = new SillyView(); content.Content = "<h1>Root.SexTaco</h1>"; return(content); }
public ISillyView About(ISillyContext context) { ISillyView content = new SillyView(); content.Content = "<h1>Root.About</h1>"; return(content); }
public ISillyView Index(ISillyContext context) { SillyView home = new SillyView(); Task <bool> result = home.LoadS3Async("sillywidgets.com", "index.html", Amazon.RegionEndpoint.USWest1); Task <Document> data = base.DynamoGetItemAsync(Amazon.RegionEndpoint.USWest1, "sillywidgets", "*****@*****.**"); result.Wait(); data.Wait(); if (!result.Result) { return(null); } home.Bind(data.Result); return(home); }
public ISillyView Dispatch(ISillyContext context) { if (context == null || context.HttpMethod == SupportedHttpMethods.Unsupported) { return(null); } string path = context.Path; if (String.IsNullOrEmpty(path) || String.IsNullOrWhiteSpace(path)) { return(null); } List <SillyRoute> availableRoutes = Routes[context.HttpMethod]; if (availableRoutes.Count == 0) { return(null); } string[] pathSegments = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); foreach (SillyRoute route in availableRoutes) { if (route.Count == 0 || !route.IsValid || pathSegments.Length > route.Count) { continue; } RouteMatchingVisitor visitor = new RouteMatchingVisitor(Controllers); if (visitor.TryMatch(route, pathSegments)) { if (visitor.Controller == null || visitor.Method == null) { continue; } int varCount = 1 + visitor.Vars.Count; object[] vars = new object[varCount]; vars[0] = context; if (visitor.Vars.Count > 0) { int index = 1; foreach (object var in visitor.Vars) { vars[index] = var; } } try { ISillyView view = visitor.Method.Invoke(visitor.Controller, vars) as ISillyView; return(view); } catch (Exception ex) { throw ex.InnerException; } } } return(null); }