Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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