protected override void UpdateModel(TreeIter iter)
{
// prevent loop when content might change in here (i.e. toggle)
SetHandleRowChanged (false);
Table2D table = store.GetValue (iter, (int)ColumnNr2D.Obj) as Table2D;
if (table == null)
return;
string nameX = (string)store.GetValue (iter, (int)ColumnNr2D.NameX);
string unitX = (string)store.GetValue (iter, (int)ColumnNr2D.UnitX);
nameX = nameX.Trim ();
unitX = unitX.Trim ();
if (unitX != table.UnitX || nameX != table.NameX) {
var shared = data.FindTablesSameAxisX (table);
if (shared.Count > 0) {
Console.WriteLine ("AxisX shared {0} times.", shared.Count);
#if SelectShared
ToggleAll (false);
foreach (var t in shared) {
t.Selected = true;
TreeIter iterDup;
if (FindIter (t, out iterDup)) {
Toggle (iterDup, true);
}
}
#endif
}
}
table.Category = (string)store.GetValue (iter, (int)ColumnNr2D.Category);
table.Title = (string)store.GetValue (iter, (int)ColumnNr2D.Title);
table.UnitY = (string)store.GetValue (iter, (int)ColumnNr2D.UnitY);
table.NameX = nameX;
table.UnitX = unitX;
table.Description = (string)store.GetValue (iter, (int)ColumnNr2D.Description);
table.Selected = IsToggled (iter);
SetHandleRowChanged (true);
}