Beispiel #1
0
        internal void SetOwnershipRegistration(MetadataReferenceSetOwnershipRegistration registration)
        {
            registration.EnsureNotNull(nameof(registration));
            //
            var original = WriteDA(location: ref _ownershipRegistration, value: registration, comparand: null);

            if (!(original is null || ReferenceEquals(objA: registration, objB: original)))
            {
                throw new EonException();
            }
        }
Beispiel #2
0
        // TODO_HIGH: Удалить. Реализовать автоматическую регистрацию (на основе Linq.Expression(s) и рефлексии).
        //
        protected void RegisterReferenceSet(MetadataReferenceSetBase referenceSet, bool useDeserializationContext)
        {
            referenceSet.EnsureNotNull(nameof(referenceSet));
            //
            var registration = new MetadataReferenceSetOwnershipRegistration(owner: this, set: referenceSet);

            ReadDA(location: ref _referenceSetRegistrySpinLock, considerDisposeRequest: true)
            .Invoke(
                action:
                () => {
                var locRegistry = ReadDA(location: ref _referenceSetRegistry, considerDisposeRequest: true);
                locRegistry.Add(item: registration);
            });
            registration.SetRegistrationCompleteFlag();
        }
Beispiel #3
0
 protected override void Dispose(bool explicitDispose)
 {
     _ownershipRegistration = null;
     //
     base.Dispose(explicitDispose);
 }