public MruItem RemoveInTail(bool moveToRemoveList) { if (_tail != null) { Count--; MruItem d = _tail.Data; if (_tail.Previous != null) { _tail.Previous.Next = null; _tail = _tail.Previous; } else { _tail = null; _head = null; } //if (Collection != null) //{ if (d.Value is Sop.DataBlock) { if (((DataBlock)d.Value).IsDirty) { if (moveToRemoveList && DataDriver != null && !RemovedObjects.ContainsKey(d.Key)) { RemovedObjects.Add(d.Key, d.Value); } } } else if (moveToRemoveList && d.Value != null) { if (!RemovedObjects.ContainsKey(d.Key)) { if (d.Value is IInternalPersistent) { if (((IInternalPersistent)d.Value).IsDirty) { RemovedObjects.Add(d.Key, d.Value); } } else { RemovedObjects.Add(d.Key, d.Value); } } } //} return(d); } return(null); }
public MruItem <TKey, TValue> RemoveInTail(bool moveToRemoveList) { if (_tail != null) { Count--; MruItem <TKey, TValue> d = _tail.Data; if (_tail.Previous != null) { _tail.Previous.Next = null; _tail = _tail.Previous; } else { _tail = null; _head = null; } if (d.Value is Sop.DataBlock) { //** check whether this needs to be supported.. //if (((DataBlock)d.Value).IsDirty) //{ // if (MoveToRemoveList && DataDriver != null && !RemovedObjects.ContainsKey(d.Value)) // RemovedObjects.Add(d.Value, d.Value); //} } else if (moveToRemoveList) { /*d.Value != null && 90;*/ if (!RemovedObjects.ContainsKey(d.Key)) { if (d.Value is IInternalPersistent) { if (((IInternalPersistent)d.Value).IsDirty) { RemovedObjects.Add(d.Key, d.Value); } } else { RemovedObjects.Add(d.Key, d.Value); } } } return(d); } return(null); }