public PulseModule() { this._data = new DataStorage(); this._model = new PulseModel(this._data); Get["/"] = parameters => { return View["pulse", this._model]; }; Get["/js/{File}"] = parameters => { return Response.AsJs("Scripts/" + parameters.File as string); }; Get["/css/{File}"] = parameters => { return Response.AsCss("Content/" + parameters.File as string); }; Get["/data/SentEmailCount_per_user"] = parameters => { var outgoingCounts = this._model.OutgoingCountPerSender(); int i = 0; return Response.AsJson(outgoingCounts.Select(uc => { var temp = new { x = i, xAxisName = uc.Item1, y = uc.Item2 }; i++; return temp; })); }; }
public static void Main() { DataStorage data = new DataStorage(); MainMenuModel mainMenuModel = new MainMenuModel(data); using (var mainMenu = new MainMenuView(mainMenuModel)) { try { mainMenu.Run(); } catch(Exception e) { TextWriter errorWriter = Console.Error; errorWriter.WriteLine("------An error has been encountered.------"); errorWriter.WriteLine(e.Message); #if DEBUG errorWriter.WriteLine(e.InnerException); errorWriter.WriteLine(e.StackTrace); #endif errorWriter.WriteLine("------The application will now close.------"); } } Console.ReadLine(); }
public RawModule(DataStorage data) : base("/raw") { Get["/"] = parameters => { return View["raw", new RawModel(data)]; }; }
public DataAnalysisEngine(DataStorage dataStorage) { if (dataStorage == null) { throw new ArgumentNullException("dataStorage"); } this._data = dataStorage; }
public DeleteModule(DataStorage data) : base("/delete") { Get["/"] = parameters => { return View["delete"]; }; Post["/all"] = parameters => { data.DeleteAll(); return Response.AsRedirect("~/"); }; }
public PulseModel(DataStorage dataStore) { this._data = dataStore; }
public MainMenuModel(DataStorage storage) { this._data = storage; }
public RawModel(DataStorage dataStore) { this._data = dataStore; }
public AddAdditionalDataModel(DataStorage storage) { this._data = storage; }