本文整理汇总了C#中TestModel.CreateAddNode方法的典型用法代码示例。如果您正苦于以下问题:C# TestModel.CreateAddNode方法的具体用法?C# TestModel.CreateAddNode怎么用?C# TestModel.CreateAddNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestModel
的用法示例。
在下文中一共展示了TestModel.CreateAddNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OneContextTwoNodes
public void OneContextTwoNodes()
{
Gtk.Application.Init ();
string context = "Context1";
TestModel model = new TestModel();
/*INode nodeA = */model.CreateAddNode(10, context, new Size(80, 50));
/*INode nodeB = */model.CreateAddNode(20, context, new Size(100, 40));
TimelineLayoutManager layout = new TimelineLayoutManager(model);
layout.Update();
TestRenderer renderer = new TestRenderer();
TimelineView view = new TimelineView(model, renderer);
Gtk.Widget[] children = view.Children;
Assert.That(children.Length, Is.EqualTo(2));
Assert.That(children[0].Visible, Is.True);
Assert.That(children[1].Visible, Is.True);
int ax = (int) view.ChildGetProperty(children[0], "x").Val;
int ay = (int) view.ChildGetProperty(children[0], "y").Val;
int bx = (int) view.ChildGetProperty(children[1], "x").Val;
int by = (int) view.ChildGetProperty(children[1], "y").Val;
Assert.That(ay, Is.GreaterThan(0));
Assert.That(ay, Is.EqualTo(by));
Assert.That(ax, Is.GreaterThan(0));
Assert.That(bx, Is.GreaterThan(0));
Assert.That(ax, Is.Not.EqualTo(bx));
}
示例2: OneContextTwoNodes
public void OneContextTwoNodes()
{
string context = "Context1";
TestModel model = new TestModel();
INode nodeA = model.CreateAddNode(10, context, new Size(80, 50));
INode nodeB = model.CreateAddNode(20, context, new Size(100, 40));
TimelineLayoutManager layout = new TimelineLayoutManager(model);
layout.Update();
Assert.That(nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
Assert.That(nodeB.Position, Is.EqualTo(new Point(layout.XMargin + nodeA.Allocation.Width + layout.XPadding, layout.YMargin)));
}
示例3: OneContextOneNode
public void OneContextOneNode()
{
string context = "Context1";
TestModel model = new TestModel();
INode node = model.CreateAddNode(10, context, new Size(100, 50));
TimelineLayoutManager layout = new TimelineLayoutManager(model);
layout.Update();
Assert.That(node.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
}
示例4: TwoContextsInSequence
public void TwoContextsInSequence()
{
TestModel model = new TestModel();
string context1 = "Context1";
INode ctx1nodeA = model.CreateAddNode(10, context1, new Size(80, 50));
INode ctx1nodeB = model.CreateAddNode(20, context1, new Size(100, 40));
string context2 = "Context2";
INode ctx2node = model.CreateAddNode(30, context2, new Size(50, 30));
TimelineLayoutManager layout = new TimelineLayoutManager(model);
layout.Update();
Assert.That(layout.RowCount, Is.EqualTo(1));
Assert.That(ctx1nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
Assert.That(ctx1nodeB.Position.X, Is.EqualTo(ctx1nodeA.Position.X + ctx1nodeA.Allocation.Width + layout.XPadding));
Assert.That(ctx1nodeB.Position.Y, Is.EqualTo(layout.YMargin));
Assert.That(ctx2node.Position.X, Is.EqualTo(ctx1nodeB.Position.X + ctx1nodeB.Allocation.Width + layout.XPadding));
Assert.That(ctx2node.Position.Y, Is.EqualTo(layout.YMargin));
}