public static string ToString(ObjectPair <object> rootPair, T obj, ToStringState state) { var objectInfo = new ObjectInfo <object>().ChangeNewObject(obj) .ChangeRootObjectPair(rootPair ?? ObjectPair <object> .Create(null, null)); var rootProp = RootProperty.Create(typeof(T)); var enumerator = EnumerateDiffNodes(objectInfo, rootProp, true); return(ToString(objectInfo.ParentObjectPair, DiffTree.FromEnumerator(enumerator, DateTime.Now).Root, state)); }
/// <summary> /// Converts the given object to a string, showing each of its properties values. /// </summary> /// <param name="rootPair">old and new document, can be null</param> /// <param name="rootNode">diff node describing root object change</param> /// <param name="state">describes how to format the string</param> /// <returns>String representation</returns> public static string ToString(ObjectPair <object> rootPair, DiffNode rootNode, ToStringState state) { return(Reflector.ToString(rootPair, rootNode, null, state).Trim()); }
/// <summary> /// Converts the given object to a string, showing each of its properties values. /// </summary> /// <param name="rootPair">old and new document, can be null</param> /// <param name="docType">May determine whether human readable version requires "peptide"->"molecule" translation</param> // CONSIDER: does this belong in ToStringState? /// <param name="rootNode">diff node describing root object change</param> /// <param name="state">describes how to format the string</param> /// <returns>String representation</returns> public static string ToString(ObjectPair <object> rootPair, SrmDocument.DOCUMENT_TYPE docType, DiffNode rootNode, ToStringState state) { return(Reflector.ToString(rootPair, docType, rootNode, null, state).Trim()); }