private string Validate(string propertyName)
        {
            // Return error message if there is error on else return empty or null string
            string validationMessage = string.Empty;

            if (_firstLoad)
            {
                return(validationMessage);
            }
            switch (propertyName)
            {
            case "Advance":
                if (!double.TryParse(Advance.ToString(), out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "Rent":
                if (!double.TryParse(Rent.ToString(), out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;
            }

            return(validationMessage);
        }
Example #2
0
        ///
        ///<summary>
        /// Save the collection to a xml node
        /// </summary>
        ///
        public bool Save(XmlWriter xml)
        {
            if (xml == null)
            {
                return(false);
            }

            xml.WriteStartElement(Tag);
            xml.WriteAttributeString("name", Name);



            if (!string.IsNullOrEmpty(TextureName))
            {
            }
            else if (!string.IsNullOrEmpty(TTFFileName))
            {
            }
            else if (!string.IsNullOrEmpty(TileSetName))
            {
                xml.WriteStartElement("tileset");
                xml.WriteAttributeString("name", TileSetName);
                xml.WriteEndElement();
            }


            xml.WriteStartElement("offset");
            xml.WriteAttributeString("value", GlyphOffset.ToString());
            xml.WriteEndElement();

            xml.WriteStartElement("advance");
            xml.WriteAttributeString("value", Advance.ToString());
            xml.WriteEndElement();

            xml.WriteStartElement("interline");
            xml.WriteAttributeString("value", Interline.ToString());
            xml.WriteEndElement();

            xml.WriteEndElement();
            return(false);
        }