private void Timer_Elapsed(object sender, ElapsedEventArgs e) { var fullName = ActiveWindowHandler.Application(); if (string.IsNullOrWhiteSpace(fullName)) { return; } WindowEvent userActivityEvent = new WindowEvent { FullName = fullName, Icon = ActiveWindowHandler.GetIconAsPng(fullName), Name = ActiveWindowHandler.GetFileName(fullName), Title = ActiveWindowHandler.Title(), DateTime = DateTime.Now }; if (!userActivityEvent.Equals(lastActivityEvent)) { lastActivityEvent = userActivityEvent; WindowActivitySnapshot?.Invoke(this, userActivityEvent); } }