Exemplo n.º 1
0
 /// <summary>
 /// Construtor usado na deserialização dos dados.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 private TokenPingResultErrorInfo(SerializationInfo info, StreamingContext context)
 {
     Type       = info.GetString("Type");
     Message    = info.GetString("Message");
     StackTrace = info.GetString("StackTrace");
     Inner      = (TokenPingResultErrorInfo)info.GetValue("Inner", typeof(TokenPingResultErrorInfo));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Cria a instancia com o erro ocorrido.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exception"></param>
 public TokenPingResultMessage(IMessageFormattable message, Exception exception)
 {
     _message = message;
     if (exception != null)
     {
         _error = new TokenPingResultErrorInfo(exception);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constrói a instancia com o erro ocorrido.
 /// </summary>
 /// <param name="exception"></param>
 public TokenPingResultErrorInfo(Exception exception)
 {
     exception.Require("exception").NotNull();
     Type       = exception.GetType().FullName;
     Message    = exception.Message;
     StackTrace = exception.StackTrace;
     if (exception.InnerException != null)
     {
         Inner = new TokenPingResultErrorInfo(exception.InnerException);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Lê os dados serializados.
 /// </summary>
 /// <param name="reader"></param>
 void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
 {
     reader.ReadStartElement();
     Message = reader.ReadElementString("Message", SecurityNamespaces.Security).GetFormatter();
     if (!reader.IsEmptyElement && reader.LocalName == "Error")
     {
         var inner = new TokenPingResultErrorInfo();
         ((System.Xml.Serialization.IXmlSerializable)inner).ReadXml(reader);
         Error = inner;
         reader.ReadEndElement();
     }
     else
     {
         reader.Skip();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Lê os dados serializados.
 /// </summary>
 /// <param name="reader"></param>
 void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
 {
     Type = reader.GetAttribute("Type");
     reader.MoveToElement();
     reader.ReadStartElement();
     Message    = reader.ReadElementString("Message", SecurityNamespaces.Security);
     StackTrace = reader.ReadElementString("StackTrace", SecurityNamespaces.Security);
     if (!reader.IsEmptyElement && reader.LocalName == "Inner")
     {
         var inner = new TokenPingResultErrorInfo();
         ((System.Xml.Serialization.IXmlSerializable)inner).ReadXml(reader);
         Inner = inner;
         reader.ReadEndElement();
     }
     else
     {
         reader.Skip();
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Construtor usado na deserialização dos dados.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 private TokenPingResultMessage(SerializationInfo info, StreamingContext context)
 {
     Message = info.GetString("Message").GetFormatter();
     Error   = (TokenPingResultErrorInfo)info.GetValue("Error", typeof(TokenPingResultErrorInfo));
 }