Back to Devexpress

ProcessDataLockingInfoController Class

expressappframework-devexpress-dot-expressapp-dot-systemmodule-0a46b003.md

latest3.2 KB
Original Source

ProcessDataLockingInfoController Class

Use this controller to implement custom strategies of conflict detection and resolution.

Namespace : DevExpress.ExpressApp.SystemModule

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public class ProcessDataLockingInfoController :
    ObjectViewController
vb
Public Class ProcessDataLockingInfoController
    Inherits ObjectViewController

Remarks

When you execute Save , Save and New , or Save and Close Actions, this controller calls the Object Space code that collects the following information:

  • Local modified objects
  • Objects modified by other users
  • Conflict detection and resolution strategies implemented in your application

You can access and modify this information in the DataLockingProcessing event.

The following code snippet enables automatic merge in XAF applications:

csharp
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;

namespace MainDemo.Module.Controllers;

public class AutoMergeViewController : ViewController {
    private ProcessDataLockingInfoController lockController;

    private void OnDataLocking(object sender, DataLockingProcessingEventArgs e) {
        foreach (var info in e.DataLockingInfo.ObjectLockingInfo) {
            info.CanAutoMerge = info.CanMerge;
        }
    }

    protected override void OnActivated() {
        base.OnActivated();
        lockController = Frame.GetController<ProcessDataLockingInfoController>();
        lockController.DataLockingProcessing += OnDataLocking;
    }

    protected override void OnDeactivated() {
        base.OnDeactivated();
        if (lockController != null) {
            lockController.DataLockingProcessing -= OnDataLocking;
            lockController = null;
        }
    }
}

Implements

ISupportUpdate

Inheritance

Object MarshalByRefObject Component Controller ViewController ViewController<ObjectView> ObjectViewController ProcessDataLockingInfoController

See Also

ProcessDataLockingInfoController Members

DevExpress.ExpressApp.SystemModule Namespace