/// <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, JackpotXmlFields 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> /// Gets or sets the <see cref="System.String"/> with the specified field name. /// </summary> public JackpotXmlField this[JackpotXmlFields fieldName] { get { if (_properties.ContainsKey(fieldName)) { return(_properties[fieldName]); } return(null); } }
/// <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="emptyLines">The empty lines.</param> /// <param name="defaultValue">The default value.</param> /// <param name="repeatableCount">The repeatable count.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultName, uint emptyLines, string defaultValue, int repeatableCount) { return(this.SaveProperty(rootElement, xmlField, defaultName, defaultValue, 1, false, emptyLines, repeatableCount)); }
/// <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="emptyLines">The empty lines.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultName, uint emptyLines) { return(this.SaveProperty(rootElement, xmlField, defaultName, string.Empty, 1, false, emptyLines, 0)); }
///// <summary> ///// Gets or sets the <see cref="System.String"/> with the specified field name. ///// </summary> //public string this[JackpotXmlFields fieldName] //{ // get // { // if (_properties.ContainsKey(fieldName)) // return _properties[fieldName].Value; // return string.Empty; // } // set // { // if (_properties.ContainsKey(fieldName)) // { // _properties[fieldName].Value = value; // } // } //} /// <summary> /// Saves the property. /// </summary> /// <param name="rootElement">The root element.</param> /// <param name="xmlField">The XML field.</param> /// <param name="defaultValue">The default value.</param> /// <param name="width">The width.</param> /// <param name="skipNewline">if set to <c>true</c> [skip newline].</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultValue) { return(this.SaveProperty(rootElement, xmlField, defaultValue, string.Empty, 1, false, 0, 0)); }
/// <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, JackpotXmlFields 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="emptyLines">The empty lines.</param> /// <param name="defaultValue">The default value.</param> /// <param name="repeatableCount">The repeatable count.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultName, uint emptyLines, string defaultValue, int repeatableCount) { return this.SaveProperty(rootElement, xmlField, defaultName, defaultValue, 1, false, emptyLines, repeatableCount); }
/// <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="emptyLines">The empty lines.</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultName, uint emptyLines) { return this.SaveProperty(rootElement, xmlField, defaultName, string.Empty, 1, false, emptyLines, 0); }
///// <summary> ///// Gets or sets the <see cref="System.String"/> with the specified field name. ///// </summary> //public string this[JackpotXmlFields fieldName] //{ // get // { // if (_properties.ContainsKey(fieldName)) // return _properties[fieldName].Value; // return string.Empty; // } // set // { // if (_properties.ContainsKey(fieldName)) // { // _properties[fieldName].Value = value; // } // } //} /// <summary> /// Saves the property. /// </summary> /// <param name="rootElement">The root element.</param> /// <param name="xmlField">The XML field.</param> /// <param name="defaultValue">The default value.</param> /// <param name="width">The width.</param> /// <param name="skipNewline">if set to <c>true</c> [skip newline].</param> /// <returns> /// True if the element is modified; otherwise false. /// </returns> private bool SaveProperty(XmlElement rootElement, JackpotXmlFields xmlField, string defaultValue) { return this.SaveProperty(rootElement, xmlField, defaultValue, string.Empty, 1, false, 0, 0); }
/// <summary> /// Gets or sets the <see cref="System.String"/> with the specified field name. /// </summary> public JackpotXmlField this[JackpotXmlFields fieldName] { get { if (_properties.ContainsKey(fieldName)) return _properties[fieldName]; return null; } }