Example #1
0
        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;
                    }));
                };
        }
Example #2
0
        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();
        }
Example #3
0
 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;
        }
Example #5
0
        public DeleteModule(DataStorage data)
            : base("/delete")
        {
            Get["/"] = parameters =>
                {
                    return View["delete"];
                };

            Post["/all"] = parameters =>
                {
                    data.DeleteAll();
                    return Response.AsRedirect("~/");
                };
        }
Example #6
0
 public PulseModel(DataStorage dataStore)
 {
     this._data = dataStore;
 }
Example #7
0
 public MainMenuModel(DataStorage storage)
 {
     this._data = storage;
 }
Example #8
0
 public RawModel(DataStorage dataStore)
 {
     this._data = dataStore;
 }
 public AddAdditionalDataModel(DataStorage storage)
 {
     this._data = storage;
 }