private void Initalize() { if (View.ObjectTypeInfo.FindAttribute <PessimisticLockingAttribute>() != null) { _pessimisticLocker = new PessimisticLocker(((XPObjectSpace)ObjectSpace).Session.DataLayer, View.CurrentObject); UpdateViewAllowEditState(); SubscribeToEvents(); } }
protected override void OnActivated() { base.OnActivated(); if (View.ObjectTypeInfo.FindAttribute <PessimisticLockingAttribute>() != null) { _pessimisticLocker = new PessimisticLocker(((XPObjectSpace)ObjectSpace).Session.DataLayer, View.CurrentObject); UpdateViewAllowEditState(); SubscribeToEvents(); } }