protected HEMessageException(HEMessage message, Exception innerException, int extraStack, bool supressStack, bool startWithInnerException) : base(message.Message + (string.IsNullOrEmpty(message.Detail) ? "" : ": " + message.Detail), innerException) { StringBuilder sb = new StringBuilder(message.ExtraInfo); if (message.ExtraInfo != "") { sb.Append("\r\n"); } if (!supressStack) { var cnt = 1; sb.Append("Exception Details:\r\n"); if (!startWithInnerException) { sb.Append("[1] {0}{1}\r\n{2}\r\n".F(message.Message, (string.IsNullOrEmpty(message.Detail) ? "" : ": " + message.Detail), getStackStraceExceptTop(2 + extraStack))); cnt = 2; } if (innerException != null) { Exception ex = innerException; while (ex != null) { string stack = GetProperStackInfo(ex); sb.Append("[{0}] {1}".F(cnt, stack)); ex = ex.InnerException; cnt++; } } } message.ExtraInfo = sb.ToString(); @HEMessage = message; }
public HEMessageException(SerializationInfo info, StreamingContext context) : base(info, context) { // IMPORTANT - Java compatibility // The order by which the fields are being retrieved here must be // the same by which they are stored in the GetObjectData method @HEMessage = (@HEMessage)info.GetValue("HEMessage", typeof(HEMessage)); }
// Note the diff in ret type in Java... public int Add(HEMessage val) { if (isReadOnly) { throw new InvalidOperationException("Cannot add messages to the list because it is read-only"); } else { return(base.Add(val)); } }
// For now we need this constructor from XML... public HEMessageArrayList(string xml) : base() { try { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); foreach (XmlElement elem in doc.SelectNodes("//Msg")) { HEMessage msg = new HEMessage(elem); this.Add(msg); } } catch (Exception ex) { throw new IOException("Error loading message list\r\nOriginal Xml : " + xml + "\r\nException : " + ex.ToString(), ex); } }
public HENotImplementedException(HEMessage message) : base(message, null, 1, false) { }
protected HEMessageException(HEMessage message, Exception innerException, int extraStack, bool supressStack) : this(message, innerException, extraStack, supressStack, /* startWithInnerException */ false) { }
public HEMessageException(HEMessage message) : this(message, /* supressStack */ false) { }
public HEMessageException(HEMessage message, bool supressStack) : this(message, /* innerException */ null, 1, supressStack) { }
public HEMessageException(HEMessage message, Exception innerException, bool startWithInnerException) : this(message, innerException, 1, /* supressStack */ false, startWithInnerException) { }
public HEMessageException(HEMessage message, Exception innerException) : this(message, innerException, 1, /* supressStack */ false) { }
public HEMessageException(SerializationInfo info, StreamingContext context) : base(info, context) { @HEMessage = (@HEMessage)info.GetValue("HEMessage", typeof(HEMessage)); }