private void SetupLazyFields(ActivatedContentContext context, AuditTrailSettingsPart part) { part._eventProviderSettingsField.Loader(() => _auditTrailManager.DeserializeProviderConfiguration(part.Retrieve <string>("Events"))); part._eventProviderSettingsField.Setter(value => { part.Store("Events", _auditTrailManager.SerializeProviderConfiguration(value)); _signals.Trigger("AuditTrail.EventSettings"); return(value); }); }
public static string ToEventData(this IAuditTrailManager auditTrailManager, string settingsData) { var settings = auditTrailManager.DeserializeProviderConfiguration(settingsData); var query = from setting in settings let descriptor = auditTrailManager.DescribeEvent(setting.EventName) select new AuditTrailEventSettingEventData { EventName = setting.EventName, IsEnabled = setting.IsEnabled, EventCategory = descriptor.CategoryDescriptor.Name.TextHint, EventDisplayName = descriptor.Name.TextHint }; return(SerializeEventData(query)); }