Beispiel #1
0
 /// <summary>
 /// Faz a desserialização do objeto.
 /// </summary>
 /// <param name="reader"></param>
 protected override void Deserialize(Colosoft.Serialization.IO.CompactReader reader)
 {
     if (reader.ReadBoolean())
     {
         _inputExpression = GetConditionalTerm(reader);
     }
     while (reader.ReadBoolean())
     {
         var caseWhenExpression = new CaseWhenExpression();
         ((Colosoft.Serialization.ICompactSerializable)caseWhenExpression).Deserialize(reader);
         _whenExpressions.Add(caseWhenExpression);
     }
     if (reader.ReadBoolean())
     {
         _elseResultExpression = GetConditionalTerm(reader);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Lê os dados serializados em XML.
 /// </summary>
 /// <param name="reader"></param>
 protected override void ReadXml(System.Xml.XmlReader reader)
 {
     reader.ReadStartElement();
     if (!reader.IsEmptyElement || reader.HasAttributes)
     {
         _inputExpression = GetConditionalTerm(reader);
     }
     else
     {
         reader.Skip();
     }
     if (!reader.IsEmptyElement && reader.LocalName == "WhenExpressions")
     {
         reader.ReadStartElement("WhenExpressions", Namespaces.Query);
         while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
         {
             var caseWhenExpression = new CaseWhenExpression();
             ((System.Xml.Serialization.IXmlSerializable)caseWhenExpression).ReadXml(reader);
             _whenExpressions.Add(caseWhenExpression);
         }
         reader.ReadEndElement();
     }
     else
     {
         reader.Skip();
     }
     if (!reader.IsEmptyElement || reader.HasAttributes)
     {
         _elseResultExpression = GetConditionalTerm(reader);
     }
     else
     {
         reader.Skip();
     }
     reader.ReadEndElement();
 }