Пример #1
0
        /// <summary> Finds the first difference in the two documents. </summary>
        private static void FindDifference(SerializeNode currentState, SerializeNode originalState, string path)
        {
            DidYouKnow.That(currentState.TypeId).Should()
            .Be(originalState.TypeId);

            var type = currentState.TypeId;

            path += "<" + type + ">";

            var fullPath = path + ".Data";

            DidYouKnow.That(currentState.GetDataOrDefault <string>("Body")).Should()
            .Be(originalState.GetDataOrDefault <string>("Body"));

            int max = Math.Min(currentState.Children.Count, originalState.Children.Count);

            for (int i = 0; i < max; i++)
            {
                FindDifference(currentState.Children[i], originalState.Children[i], path + ".[" + i + "]");
            }

            var theFullPath = path + ".Count";

            DidYouKnow.That(currentState.Children.Count).Should().Be(originalState.Children.Count);
        }
Пример #2
0
        /// <summary />
        public void Deserialize(SerializationContext context, SerializeNode node)
        {
            var text = node.GetDataOrDefault <string>("Body");

            Insert(GetCaretAtStart(), new TextBlockContent(text), autoMerge: false);
        }