+ /// <summary>
+ /// Sets the index into the container records for the original version. Apart
+ /// from that, it makes sure it pools the record used earlier if they are not
+ /// used by other versions.
+ /// </summary>
+ internal int Original
+ {
+ get { return _original;}
+ set {
+ if (_original == value)
+ return;
+
+ if (_original >= 0
+ && _current != _original
+ && _proposed != _original)
+ Table.RecordCache.DisposeRecord (_original);
+ _original = value;
+ }
+ }
+
+ /// <summary>
+ /// Sets the index into the container records for the proposed version. Apart
+ /// from that, it makes sure it pools the record used earlier if they are not
+ /// used by other versions.
+ internal int Proposed
+ {
+ get { return _proposed;}
+ set {
+ if (_proposed == value)
+ return;
+ if (_proposed >= 0
+ && _proposed != _current
+ && _proposed != _original)
+ Table.RecordCache.DisposeRecord (_proposed);
+ _proposed = value;
+ }
+ }
+
+ /// <summary>
+ /// Sets the index into the container records for the current version. Apart
+ /// from that, it makes sure it pools the record used earlier if they are not
+ /// used by other versions.
+ internal int Current
+ {
+ get { return _current;}
+ set {
+ if (_current == value)
+ return;
+ if (_current >= 0
+ && _current != _original
+ && _current != _proposed)
+ Table.RecordCache.DisposeRecord (_current);
+ _current = value;
+ }
+ }
+
+ /// <summary>
+ /// Set a value for the column into the offset specified by the version.<br>
+ /// If the value is auto increment or null, necessary auto increment value
+ /// or the default value will be used.
+ /// </summary>
+ internal void SetValue (int column, object value, int version)
+ {
+ DataColumn dc = Table.Columns[column];
+
+ if (value == null && ! dc.AutoIncrement) // set default value / auto increment
+ value = dc.DefaultValue;
+
+ Table.ChangingDataColumn (this, dc, value);
+ CheckValue (value, dc);
+ if ( ! dc.AutoIncrement)
+ dc [version] = value;
+ else if (_proposed >= 0 && _proposed != version) // proposed holds the AI
+ dc [version] = dc [_proposed];
+ }
+