AjTalk.Transactions.TransactionalObject.this C# (CSharp) Метод

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

public this ( int n ) : object
n int
Результат object
        public object this[int n]
        {
            get
            {
                lock (this)
                {
                    if (TransactionManager.CurrentTransaction == null && !this.manager.HasTransactions())
                    {
                        if (this.values.Count > 0)
                            this.ReleaseValues();

                        return this.inner[n];
                    }

                    if (this.values.ContainsKey(n))
                    {
                        if (TransactionManager.CurrentTransaction == null)
                            return this.values[n].GetValue(this.manager.Time);
                        else
                            return this.values[n].GetValue(TransactionManager.CurrentTransaction);
                    }

                    return this.inner[n];
                }
            }

            set
            {
                lock (this)
                {
                    if (TransactionManager.CurrentTransaction == null && !this.manager.HasTransactions())
                    {
                        if (this.values.Count > 0)
                            this.ReleaseValues();

                        this.inner[n] = value;
                        return;
                    }

                    if (!this.values.ContainsKey(n))
                    {
                        TransactionalValue tv = new TransactionalValue(this, n);
                        this.values[n] = tv;
                    }

                    if (TransactionManager.CurrentTransaction == null)
                        this.values[n].SetValue(this.manager.Time, value);
                    else
                        this.values[n].SetValue(TransactionManager.CurrentTransaction, value);
                }
            }
        }