Ejemplo n.º 1
0
 protected List <ScreenUnit> GetScreenUnits()
 {
     using (var dbContext = _dbContextFactory.Create())
     {
         return(dbContext.ScreenUnits.ToList());
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var dbContextFactory = new MouseHeatmapDbContextFactory(
                databaseLocation: "Source",
                databaseName: "MouseHeatmapDb.sqlite");

            dbContextFactory.FindDatabase();

            using (var dbContext = dbContextFactory.Create())
            {
                var cleanedScreenUnits = RemoveNegativeValues(dbContext.ScreenUnits);

                var heatmap = new Heatmap(cleanedScreenUnits);

                heatmap
                .Draw(MousePassedSelector)
                .ScaleUp(2)
                .SaveToSubdirectory("results", "MousePassedHeatmap.jpg");

                heatmap
                .Draw(MouseFinishedSelector)
                .ScaleUp(2)
                .SaveToSubdirectory("results", "MouseFinishedHeatmap.jpg");

                heatmap
                .Draw(SpeedSelector)
                .ScaleUp(2)
                .SaveToSubdirectory("results", "SpeedHeatmap.jpg");
            }
        }
Ejemplo n.º 3
0
        protected void StartCollecting()
        {
            _dbContextFactory = new MouseHeatmapDbContextFactory(
                databaseLocation: TestDatabaseLocation,
                databaseName: TestDatabaseName);

            _dbContextFactory.FindDatabase();
            _dbContextFactory.Create().Database.Initialize(true);

            _collector = new MouseMovementsCollector(
                _mockTimeProvider,
                new DataRecorder(_dbContextFactory),
                new MockKeyboardMouseEventsFactory(_mockEvents)
                );

            _collector.Start();
        }