public static void EnableAuditLogging(bool enable, SkylineWindow window) { Settings.Default.AuditLogging = enable; var entry = AuditLogEntry.CreateLogEnabledDisabledEntry(window.Document); window.ModifyDocumentNoUndo(doc => doc.ChangeAuditLog(ImmutableList <AuditLogEntry> .ValueOf(doc.AuditLog.AuditLogEntries.Concat(new[] { entry })))); }