public IEnumerator <KeyValuePair <int, DB2Row <T> > > GetEnumerator() { for (int i = MinIndex; i <= MaxIndex; ++i) { DB2Row <T> row = this[i]; if (row != null) { yield return(new KeyValuePair <int, DB2Row <T> >(i, row)); } } }
public DB2Row <T> this[int key] { get { DB2Row <T> result; if (cache.TryGetValue(key, out result)) { return(result); } IntPtr rowPtr = Memory.Read <IntPtr>(db2Internal.Rows + (key - db2Internal.MinIndex) * IntPtr.Size); if (rowPtr != IntPtr.Zero) { result = new DB2Row <T>(rowPtr); cache.Add(key, result); return(result); } return(null); } }
public bool TryGetValue(int key, out DB2Row <T> value) { value = this[key]; return(value != null); }