本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}