Skip to main content
All docs
V24.1
.NET 6.0+

IAuditTrailServiceRoot.CustomCreateObjectAuditProcessorsFactory Event

Handle this event to replace a default ObjectAuditProcessor for a particular object auditing mode with a custom processor.

Namespace: DevExpress.Persistent.BaseImpl.AuditTrail.Services

Assembly: DevExpress.Persistent.BaseImpl.Xpo.v24.1.dll

Declaration

event EventHandler<CustomCreateObjectAuditProcessorsFactoryEventArgs> CustomCreateObjectAuditProcessorsFactory

Event Data

The CustomCreateObjectAuditProcessorsFactory event's data class is DevExpress.Persistent.AuditTrail.CustomCreateObjectAuditProcessorsFactoryEventArgs.

Remarks

The following example demonstrates how to handle this event:

In .NET Applications

File: MySolution.Blazor.Server\Startup.cs, MySolution.Win\Startup.cs, MySolution.WebApi\Startup.cs

using DevExpress.Persistent.AuditTrail;
// ...
builder.Modules
    .AddAuditTrailXpo(o => {
        o.Events.OnCustomCreateObjectAuditProcessorsFactory = context => {
            context.ObjectAuditProcessorsFactory = new ObjectAuditProcessorsFactory(ObjectAuditingMode.Full,
                typeof(CustomAuditProcessor));
        };
    })

In .NET Framework Applications

using DevExpress.Persistent.AuditTrail;
// ...
public class Program {
    [STAThread]
    public static void Main(string[] arguments) {
        // ...
        MainDemoWinApplication winApplication = new MainDemoWinApplication();
        AuditTrailService.Instance.CustomCreateObjectAuditProcessorsFactory += 
            new EventHandler<CustomCreateObjectAuditProcessorsFactoryEventArgs>(Instance_CustomCreateObjectAuditProcessorsFactory);
    }
    // ...
    static void Instance_CustomCreateObjectAuditProcessorsFactory(object sender, 
    CustomCreateObjectAuditProcessorsFactoryEventArgs e) {
        e.Factory = new ObjectAuditProcessorsFactory(ObjectAuditingMode.Full, 
        typeof(CustomAuditProcessor));
    }
}
See Also