public override string ToString() { string result = string.Format("{0}:\n", this.GetType()); result += string.Format("inner amqp message: \n{0}\n", AMQPMessageCloak.ToString(message)); result += "NMS Fields = [\n"; foreach (MemberInfo info in this.GetType().GetMembers()) { if (info is PropertyInfo) { PropertyInfo prop = info as PropertyInfo; if (prop.GetGetMethod(true).IsPublic) { try { Object val = prop.GetValue(this, null); if (val is IPrimitiveMap) { result += prop.Name + " = " + ConversionSupport.ToString(val as IPrimitiveMap) + ",\n"; } else { result += string.Format("{0} = {1},\n", prop.Name, val); } }catch (TargetInvocationException tie) { Tracer.InfoFormat("Failed to invoke Member field accessor: {0}, cause: {1}", prop.Name, tie); } } } } result = result.Substring(0, result.Length - 2) + "\n]"; return(result); }
public override string ToString() { string result = base.ToString(); if (this.map != null) { result += string.Format("\nMessage Body: {0}\n", ConversionSupport.ToString(this.map)); } return(result); }