protected List <ScreenUnit> GetScreenUnits() { using (var dbContext = _dbContextFactory.Create()) { return(dbContext.ScreenUnits.ToList()); } }
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"); } }
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(); }