Exemple #1
0
        /// <summary>
        /// Lê os dados serializados.
        /// </summary>
        /// <param name="reader"></param>
        void System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            if (reader.MoveToAttribute("uid"))
            {
                Uid = Guid.Parse(reader.ReadContentAsString());
            }
            if (reader.MoveToAttribute("name"))
            {
                Name = reader.ReadContentAsString();
            }
            if (reader.MoveToAttribute("inputValidate"))
            {
                var inputValidate = reader.ReadContentAsString();
                if (!string.IsNullOrEmpty(inputValidate))
                {
                    this.InputValidateUid = Guid.Parse(inputValidate);
                }
            }
            if (reader.MoveToAttribute("parse"))
            {
                var parse = reader.ReadContentAsString();
                if (!string.IsNullOrEmpty(parse))
                {
                    ParseId = int.Parse(parse);
                }
            }
            if (reader.MoveToAttribute("options"))
            {
                Options = (InputRulesOptions)Enum.Parse(typeof(InputRulesOptions), reader.ReadContentAsString());
            }
            if (reader.MoveToAttribute("copyValue"))
            {
                CopyValue = reader.ReadContentAsBoolean();
            }
            reader.MoveToElement();
            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement();
                while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
                {
                    switch (reader.LocalName)
                    {
                    case "Label":
                        Label = reader.ReadElementContentAsString();
                        break;

                    default:
                        reader.Skip();
                        break;
                    }
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Skip();
            }
        }
Exemple #2
0
 /// <summary>
 /// Lê os dados serializados.
 /// </summary>
 /// <param name="reader"></param>
 void System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
 {
     if (reader.MoveToAttribute("identifier"))
     {
         Identifier = reader.ReadContentAsString();
     }
     if (reader.MoveToAttribute("validation"))
     {
         Validation = reader.ReadContentAsString();
     }
     if (reader.MoveToAttribute("inputRulesGroupUid"))
     {
         InputRulesGroupUid = Guid.Parse(reader.ReadContentAsString());
     }
     if (reader.MoveToAttribute("reloadSettings"))
     {
         ReloadSettings = reader.ReadContentAsBoolean();
     }
     if (reader.MoveToAttribute("copyValue"))
     {
         ReloadSettings = reader.ReadContentAsBoolean();
     }
     reader.MoveToElement();
 }
		/// <summary>
		/// Lê os dados serializados.
		/// </summary>
		/// <param name="reader"></param>
		void System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
		{
			if(reader.MoveToAttribute("name"))
				Name = reader.ReadContentAsString();
			if(reader.MoveToAttribute("isInstance"))
				IsInstance = reader.ReadContentAsBoolean();
			if(reader.MoveToAttribute("type"))
			{
				var type = reader.ReadContentAsString();
				Type = !string.IsNullOrEmpty(type) ? new Reflection.TypeName(reader.ReadContentAsString()) : null;
			}
			if(reader.MoveToAttribute("inputRulesGroup"))
			{
				var inputRulesGroupUid = reader.ReadContentAsString();
				InputRulesGroupUid = !string.IsNullOrEmpty(inputRulesGroupUid) ? (Guid?)Guid.Parse(inputRulesGroupUid) : null;
			}
			reader.MoveToElement();
			if(!reader.IsEmptyElement)
			{
				reader.ReadStartElement();
				while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
				{
					if(reader.LocalName == "DefaultLabels" && !reader.IsEmptyElement)
					{
						reader.ReadStartElement();
						while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
						{
							if(reader.LocalName == "PropertyDefaultLabel")
							{
								var label = new PropertyDefaultLabel();
								((System.Xml.Serialization.IXmlSerializable)label).ReadXml(reader);
								DefaultLabels.Add(label);
							}
							else
								reader.Skip();
						}
						reader.ReadEndElement();
					}
					else
						reader.Skip();
				}
				reader.ReadEndElement();
			}
			else
				reader.Skip();
		}
Exemple #4
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            if (reader.IsEmptyElement)
            {
                return;
            }

            reader.Read();
            while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                Debug.Assert(reader.Name == "Pair");
                var key = int.Parse(reader.GetAttribute("key"));
                reader.ReadStartElement("Pair");
                var val = reader.ReadContentAsBoolean();
                reader.ReadEndElement();
                this[key] = val;
            }
        }
Exemple #5
0
 void System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
 {
     if (reader.MoveToAttribute("Reverse"))
     {
         _reverse = reader.ReadContentAsBoolean();
     }
     reader.MoveToElement();
     reader.ReadStartElement();
     if (!reader.IsEmptyElement || reader.HasAttributes)
     {
         reader.ReadStartElement();
         _term = ConditionalTerm.GetConditionalTerm(reader);
         reader.ReadEndElement();
     }
     else
     {
         reader.Skip();
     }
     reader.ReadEndElement();
 }