private void WriteKey(DataKey key)
{
long num = key.position;
this.file.WriteKey(key);
if (key.position != num)
{
DataKey @class = null;
if (key.number != 0)
@class = this.cache[key.number - 1];
if (@class != null)
{
@class.next = key.position;
if ([email protected])
SetNext(key.prev, key.position);
}
else if (key.prev != -1)
SetNext(key.prev, key.position);
DataKey class2 = null;
if (key.number != this.bufferCount - 1)
class2 = this.cache[key.number + 1];
if (class2 != null)
{
class2.prev = key.position;
if (!class2.changed)
SetPrev(key.next, key.position);
}
else if (key.next != -1)
SetPrev(key.next, key.position);
}
if (key == this.writeKey)
{
if (this.position1 == -1)
this.position1 = this.writeKey.position;
this.position2 = this.writeKey.position;
}
this.file.WriteKey(this.key);
}