public void Save() { // if there are no columns remove tag "cols" if (columns.Count == 0) { data.Remove(); return; } // clear existing columns data.RemoveNodes(); // recalculate columns range ColumnRange lastRange = null; Column lastColumn = null; foreach (var column in columns) { if (lastRange == null || !AreEqual(lastColumn, column)) { lastRange = column.ToRange(data.Add("col")); lastColumn = column; } else { lastRange.Max = column.Index + 1; } } }
public void Remove() { drawings.Remove(this); data.Remove(); }