public void AddEventLog(Bitmap icon, string text) { Model.SettingsRow settings = Context.Model.GetSettings(); if (!settings.EnableLogging) { return; } lock (events) { events.AddEvent(new LogEvent(icon, DateTime.Now, text)); } if (IsHandleCreated) { BeginInvoke(new UpdateEventsDelegate(UpdateEvents)); } }