Exemplo n.º 1
0
        public string ToString(IMessageSerializable objectToPrint, bool includeBytes, int indentLevel = 0, string separator = null, string bytesSeparator = null, bool putBytesAfter = false, ToStringFormatProperties formatProperties = null)
        {
            MessageSerializedClassInfo classInfo = GetClassInfo(objectToPrint.GetType());

            string stringResult = string.Empty;

            if ((includeBytes && (putBytesAfter == false)))
            {
                stringResult += ArrayOps.GetHexStringFromByteArray(classInfo.Serializer.Serialize(objectToPrint), bytesSeparator) + separator;
            }

            stringResult += classInfo.Serializer.ToString(
                objectToPrint,
                indentLevel,
                formatProperties ?? ToStringFormatProperties.Default);

            if ((includeBytes && putBytesAfter))
            {
                stringResult += separator + ArrayOps.GetHexStringFromByteArray(classInfo.Serializer.Serialize(objectToPrint), bytesSeparator);
            }

            return(stringResult);
        }
Exemplo n.º 2
0
 public string ToString(IMessageSerializable objectToPrint, int indentLevel, ToStringFormatProperties formatProperties = null)
 {
     return(ToString(objectToPrint, true, indentLevel, null, null, false, formatProperties));
 }
Exemplo n.º 3
0
        public string GetClassInfoString(IMessageSerializable objectForInfo, int indentLevel = 0)
        {
            MessageSerializedClassInfo classInfo = GetClassInfo(objectForInfo.GetType());

            return(classInfo.ToString(indentLevel));
        }