private Change Inc(string part) { var val = Get(part); var change = new Change { From = val, To = ++val }; Set(part, change.To); return change; }
private Change Set(XElement elem, int val) { var attr = elem.Attribute("value"); var change = new Change { From = Get(attr), To = val }; attr.SetValue(val); return change; }