当前位置: 首页>>代码示例>>C#>>正文


C# CSSNode.calculateLayout方法代码示例

本文整理汇总了C#中CSSNode.calculateLayout方法的典型用法代码示例。如果您正苦于以下问题:C# CSSNode.calculateLayout方法的具体用法?C# CSSNode.calculateLayout怎么用?C# CSSNode.calculateLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSSNode的用法示例。


在下文中一共展示了CSSNode.calculateLayout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: testInvalidatesCacheWhenChildAdded

        public void testInvalidatesCacheWhenChildAdded()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            CSSNode c0c1 = new CSSNode();
            CSSNode c1c0 = new CSSNode();
            c0c1.Width = 200;
            c0c1.Height = 200;
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);
            c0c0.addChildAt(c1c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c0.addChildAt(c0c1, 1);

            root.calculateLayout();
            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsTrue(c0c1.HasNewLayout);

            Assert.IsTrue(c0c0.HasNewLayout);
            Assert.IsTrue(c1.HasNewLayout);

            Assert.IsFalse(c1c0.HasNewLayout);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:30,代码来源:LayoutCachingTest.cs

示例2: testCachesFullTree

        public void testCachesFullTree()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);

            root.calculateLayout();
            assertTreeHasNewLayout(true, root);
            markLayoutAppliedForTree(root);

            root.calculateLayout();
            Assert.IsTrue(root.HasNewLayout);
            assertTreeHasNewLayout(false, c0);
            assertTreeHasNewLayout(false, c1);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:19,代码来源:LayoutCachingTest.cs

示例3: testInvalidateCacheWhenHeightChangesPosition

        public void testInvalidateCacheWhenHeightChangesPosition()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c1c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c1.addChildAt(c1c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c0.Height = 100;
            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsTrue(c1.HasNewLayout);
            Assert.IsFalse(c1c0.HasNewLayout);
        }
开发者ID:emilsjolander,项目名称:css-layout,代码行数:21,代码来源:LayoutCachingTest.cs

示例4: testDoesNotInvalidateCacheWhenPropertyIsTheSame

        public void testDoesNotInvalidateCacheWhenPropertyIsTheSame()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);
            root.Width = 200;

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            root.Width = 200;
            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            assertTreeHasNewLayout(false, c0);
            assertTreeHasNewLayout(false, c1);
        }
开发者ID:emilsjolander,项目名称:css-layout,代码行数:21,代码来源:LayoutCachingTest.cs

示例5: testInvalidatesCacheWhenEnumPropertyChanges

        public void testInvalidatesCacheWhenEnumPropertyChanges()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c1.AlignSelf = CSSAlign.Center;
            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c1.HasNewLayout);

            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsFalse(c0c0.HasNewLayout);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:22,代码来源:LayoutCachingTest.cs

示例6: testInvalidatesOnNewMeasureFunction

        public void testInvalidatesOnNewMeasureFunction()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c1.setMeasureFunction((node, width, height) => new MeasureOutput(100, 20));

            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c1.HasNewLayout);

            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsFalse(c0c0.HasNewLayout);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:23,代码来源:LayoutCachingTest.cs

示例7: testInvalidatesFullTreeWhenParentWidthChanges

        public void testInvalidatesFullTreeWhenParentWidthChanges()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            CSSNode c1c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);
            c1.addChildAt(c1c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c0.Height = 200;
            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsTrue(c0c0.HasNewLayout);

            Assert.IsTrue(c1.HasNewLayout);
            Assert.IsFalse(c1c0.HasNewLayout);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:25,代码来源:LayoutCachingTest.cs

示例8: testInvalidatesCacheWhenFloatPropertyChanges

        public void testInvalidatesCacheWhenFloatPropertyChanges()
        {
            CSSNode root = new CSSNode();
            CSSNode c0 = new CSSNode();
            CSSNode c1 = new CSSNode();
            CSSNode c0c0 = new CSSNode();
            root.addChildAt(c0, 0);
            root.addChildAt(c1, 1);
            c0.addChildAt(c0c0, 0);

            root.calculateLayout();
            markLayoutAppliedForTree(root);

            c1.SetMargin(CSSSpacingType.Left, 10);
            root.calculateLayout();

            Assert.IsTrue(root.HasNewLayout);
            Assert.IsTrue(c1.HasNewLayout);

            Assert.IsTrue(c0.HasNewLayout);
            Assert.IsFalse(c0c0.HasNewLayout);
        }
开发者ID:tryroach,项目名称:css-layout,代码行数:22,代码来源:LayoutCachingTest.cs


注:本文中的CSSNode.calculateLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。