Example #1
0
        private Scene(VisualNode root, Dictionary <IVisual, IVisualNode> index, SceneLayers layers, int generation)
        {
            Contract.Requires <ArgumentNullException>(root != null);

            var renderRoot = root.Visual as IRenderRoot;

            _index         = index;
            Root           = root;
            Layers         = layers;
            Generation     = generation;
            root.LayerRoot = root.Visual;
        }
Example #2
0
        private Scene(VisualNode root, Dictionary <IVisual, IVisualNode> index, SceneLayers layers, int generation)
        {
            _ = root ?? throw new ArgumentNullException(nameof(root));

            var renderRoot = root.Visual as IRenderRoot;

            _index         = index;
            Root           = root;
            Layers         = layers;
            Generation     = generation;
            root.LayerRoot = root.Visual;
        }
Example #3
0
        /// <summary>
        /// Makes a deep clone of the layers.
        /// </summary>
        /// <returns>The cloned layers.</returns>
        public SceneLayers Clone()
        {
            var result = new SceneLayers(_root);

            foreach (var src in _inner)
            {
                var dest = src.Clone();
                result._index.Add(dest.LayerRoot, dest);
                result._inner.Add(dest);
            }

            return(result);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeferredDrawingContextImpl"/> class.
 /// </summary>
 /// <param name="sceneBuilder">
 /// A scene builder used for constructing child scenes for visual brushes.
 /// </param>
 /// <param name="layers">The scene layers.</param>
 public DeferredDrawingContextImpl(ISceneBuilder sceneBuilder, SceneLayers layers)
 {
     _sceneBuilder = sceneBuilder;
     Layers        = layers;
 }