/// <summary> /// Saves the property. /// </summary> /// <param name="rootElement">The root element.</param> /// <param name="xmlField">The XML field.</param> /// <param name="defaultName">The default name.</param> /// <param name="defaultValue">The default value.</param> /// <param name="widthPercentage">The width percentage.</param> /// <param name="skipNewline">if set to <c>true</c> [skip newline].</param> /// <param name="emptyLines">The empty lines.</param> /// <param name="repeatbleCount">The repeatble count.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, VaultSlipXmlFields xmlField, string defaultName, string defaultValue, float widthPercentage, bool skipNewline, uint emptyLines, int repeatbleCount) { string propName = xmlField.ToString(); XmlElement xElem = rootElement.SelectSingleNode(string.Format("Property[@Name='{0}']", propName)) as XmlElement; bool result = false; if (xElem == null) { xElem = rootElement.OwnerDocument.CreateElement("Property"); rootElement.AppendChild(xElem); result = true; } JackpotXmlField field = null; if (!_properties.ContainsKey(xmlField)) { field = new JackpotXmlField(_textSettings, propName); _properties.Add(xmlField, field); } else { field = _properties[xmlField]; } field.FieldName = this.GetAttributeString(xElem, "Name", propName, ref result); field.FieldName = this.GetAttributeString(xElem, "DisplayName", defaultName, ref result); field.Value = this.GetAttributeString(xElem, "Value", defaultValue, ref result); field.WidthPercentage = widthPercentage; field.SkipNewLine = skipNewline; field.EmptyLines = emptyLines; field.RepeatableCount = repeatbleCount; return(result); }
/// <summary> /// Saves the property. /// </summary> /// <param name="rootElement">The root element.</param> /// <param name="xmlField">The XML field.</param> /// <param name="defaultName">The default name.</param> /// <param name="defaultValue">The default value.</param> /// <param name="widthPercentage">The width percentage.</param> /// <param name="skipNewline">if set to <c>true</c> [skip newline].</param> /// <param name="emptyLines">The empty lines.</param> /// <param name="repeatbleCount">The repeatble count.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, VaultSlipXmlFields xmlField, string defaultName, string defaultValue, float widthPercentage, bool skipNewline, uint emptyLines, int repeatbleCount) { string propName = xmlField.ToString(); XmlElement xElem = rootElement.SelectSingleNode(string.Format("Property[@Name='{0}']", propName)) as XmlElement; bool result = false; if (xElem == null) { xElem = rootElement.OwnerDocument.CreateElement("Property"); rootElement.AppendChild(xElem); result = true; } JackpotXmlField field = null; if (!_properties.ContainsKey(xmlField)) { field = new JackpotXmlField(_textSettings, propName); _properties.Add(xmlField, field); } else { field = _properties[xmlField]; } field.FieldName = this.GetAttributeString(xElem, "Name", propName, ref result); field.FieldName = this.GetAttributeString(xElem, "DisplayName", defaultName, ref result); field.Value = this.GetAttributeString(xElem, "Value", defaultValue, ref result); field.WidthPercentage = widthPercentage; field.SkipNewLine = skipNewline; field.EmptyLines = emptyLines; field.RepeatableCount = repeatbleCount; return result; }