Ejemplo n.º 1
0
        internal void AddDiff(RenderTreeDiff diff)
        {
            var componentId = diff.ComponentId;

            if (!DiffsByComponentId.ContainsKey(componentId))
            {
                DiffsByComponentId.Add(componentId, new List <CapturedRenderTreeDiff>());
            }

            var renderTreeEdits  = diff.Edits.ToArray();
            var capturedTreeDiff = new CapturedRenderTreeDiff(diff.ComponentId, renderTreeEdits);

            DiffsByComponentId[componentId].Add(capturedTreeDiff);
            DiffsInOrder.Add(capturedTreeDiff);
        }
Ejemplo n.º 2
0
        internal void AddDiff(RenderTreeDiff diff)
        {
            var componentId = diff.ComponentId;

            if (!DiffsByComponentId.ContainsKey(componentId))
            {
                DiffsByComponentId.Add(componentId, new List <RenderTreeDiff>());
            }

            // Clone the diff, because its underlying storage will get reused in subsequent batches
            var diffClone = new RenderTreeDiff(
                diff.ComponentId,
                new ArraySegment <RenderTreeEdit>(diff.Edits.ToArray()));

            DiffsByComponentId[componentId].Add(diffClone);
            DiffsInOrder.Add(diffClone);
        }