private void queryButton_Click(object sender, EventArgs e) { // Assign new start and end date time values and invalidate InfoPanel start = startDateTime.Value; end = endDateTime.Value; InfoPanel.Invalidate(true); }
public Form1() { // Create a folder to store ProcessClock files if it doesn't already exist string subPath = path + "\\ProcessClock"; this.Icon = new Icon(path + "\\source\\repos\\ProcessClock\\icon\\icon.ico"); CheckDirectories(subPath); // Initialize components and variables, make components redraw on resize InitializeComponent(); ResizeRedraw = true; dict = new Dictionary <String, TimeSpan>(); mapping = new Dictionary <String, String>(); // Set maximum date on options DateTime now = DateTime.Now; startDateTime.MaxDate = now; endDateTime.MaxDate = now; // Set minimum date on options DateTime min = getMinimumDate(); startDateTime.MinDate = min; endDateTime.MinDate = min; InfoPanel.Invalidate(true); LoadData(subPath, dict, curr); // Set current process currprocess = "ProcessClock"; dele = new WinEventDelegate(WinEventProc); IntPtr m_hhook = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, dele, 0, 0, WINEVENT_OUTOFCONTEXT); // Make sure that stuff after midnight doesn't spill over Action switchFilesAtMidnight = () => recordWindowSwitch(true); DateTime nextMidnight = DateTime.Today.AddDays(1); Debug.WriteLine("Time scheduled for: " + nextMidnight); ScheduleAction(switchFilesAtMidnight, nextMidnight); }
private void InfoPanel_Scroll(object sender, ScrollEventArgs e) { InfoPanel.Invalidate(); }