コード例 #1
0
ファイル: DrawBoxCalculator.cs プロジェクト: JeyDotC/CoreUI
        private DrawableNode PrecalculateMeasures(CoreUIDomNode node, DrawableNode closestBlockParent)
        {
            var drawable = new DrawableNode {
                OriginalNode       = node,
                ClosestBlockParent = closestBlockParent,
            };

            var nodeAsElement = node as CoreUIDomElement;
            var childrensClosestBlockParent = closestBlockParent;

            if (nodeAsElement != null)
            {
                drawable.Style = new Style(nodeAsElement.Style);
                if (nodeAsElement.Style.Display == DisplayStyle.Block)
                {
                    childrensClosestBlockParent = drawable;
                }
            }

            // Do the pre-calculation here.

            var children = node.Children.Where(child =>
            {
                var element = child as CoreUIDomElement;

                return(element == null || element.Style.Display != DisplayStyle.None);
            }).Select(child => PrecalculateMeasures(child, childrensClosestBlockParent));

            foreach (var child in children)
            {
                drawable.Add(child);
            }

            return(drawable);
        }
コード例 #2
0
ファイル: DrawableNode.cs プロジェクト: JeyDotC/CoreUI
        public DrawableNode Add(DrawableNode node)
        {
            if (node == this)
            {
                throw new InvalidOperationException("Adding a node to itself can cause infinite recursion!");
            }

            node.Parent = this;

            _children.Add(node);

            return(this);
        }
コード例 #3
0
ファイル: DrawBoxCalculator.cs プロジェクト: JeyDotC/CoreUI
        internal DrawableNode CalculateDrawableDom(CoreUIDomDocument document)
        {
            var documentNode = new DrawableNode
            {
                PartialDrawBox = new PartialDrawBox(document.DrawBox),
                OriginalNode   = document,
            };
            var drawableNode = PrecalculateMeasures(document.Body, documentNode);

            drawableNode = CompleteMeasures(drawableNode);
            drawableNode = CalculatePositions(drawableNode);
            drawableNode = Reflow(drawableNode);

            return(drawableNode);
        }
コード例 #4
0
ファイル: DrawBoxCalculator.cs プロジェクト: JeyDotC/CoreUI
 private DrawableNode Reflow(DrawableNode drawableTree)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
ファイル: DrawBoxCalculator.cs プロジェクト: JeyDotC/CoreUI
 private DrawableNode CalculatePositions(DrawableNode drawableTree)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
ファイル: DrawBoxCalculator.cs プロジェクト: JeyDotC/CoreUI
 private DrawableNode CompleteMeasures(DrawableNode drawableTree)
 {
     throw new NotImplementedException();
 }