AjTalk.Transactions.Transaction.RegisterValue C# (CSharp) Метод

RegisterValue() публичный Метод

public RegisterValue ( TransactionalValue value ) : void
value TransactionalValue
Результат void
        public void RegisterValue(TransactionalValue value)
        {
            if (this.values.Contains(value))
                return;
            this.values.Add(value);
        }

Usage Example

Пример #1
0
        public void SetValue(Transaction transaction, object value)
        {
            if (this.transaction != null && this.transaction != transaction)
                throw new InvalidOperationException("Another transaction modified this value");

            foreach (long time in this.committedValues.Keys)
                if (time > transaction.Start)
                    throw new InvalidOperationException("Another transaction modified this value");

            if (this.transaction == null)
                transaction.RegisterValue(this);

            this.transaction = transaction;
            this.value = value;
        }