Exemplo n.º 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;
                    }));
                };
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public RawModule(DataStorage data)
     : base("/raw")
 {
     Get["/"] = parameters =>
         {
             return View["raw", new RawModel(data)];
         };
 }
Exemplo n.º 4
0
        public DataAnalysisEngine(DataStorage dataStorage)
        {
            if (dataStorage == null)
            {
                throw new ArgumentNullException("dataStorage");
            }

            this._data = dataStorage;
        }
Exemplo n.º 5
0
        public DeleteModule(DataStorage data)
            : base("/delete")
        {
            Get["/"] = parameters =>
                {
                    return View["delete"];
                };

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