/// <summary> /// Save the display settings to the specified XML node. /// </summary> /// <param name="display">XML node display settings should be added to.</param> public void SaveTo(XmlNode display) { if(WindowState != FormWindowState.Normal) display.AddElement("WindowState", (int)WindowState); if(Location.X != -42 && Location.Y != -42) display.AddElement("Location", string.Format("{0},{1}", Location.X, Location.Y)); if(Size.Width != -42 && Size.Height != -42) display.AddElement("Size", string.Format("{0}x{1}", Size.Width, Size.Height)); }
/// <summary> /// Gets a nested value. /// </summary> /// <param name="tokenValue">The nested token value.</param> /// <param name="map">The field mapping.</param> /// <param name="target">The target object to populate with mapped key/values.</param> private void GetNestedValue(IEnumerable<object> tokenValue, MappedField map, XmlNode target) { XmlNode repeaterNode = target.AddElement(map.Target); foreach (object row in tokenValue) { XmlNode rowNode = repeaterNode.AddElement(HttpResources.XmlRepeaterRowIdentifier); var fields = row as NestedDictionary; if (fields != null) { foreach (KeyValuePair<string, object> field in fields) { rowNode.AddElement(field.Key, field.Value.ToString()); } } else { rowNode.AddElement(row.ToString()); } } }