本文整理汇总了C#中DesignScriptStudio.Graph.Core.GraphController.DoCreateFunctionNode方法的典型用法代码示例。如果您正苦于以下问题:C# GraphController.DoCreateFunctionNode方法的具体用法?C# GraphController.DoCreateFunctionNode怎么用?C# GraphController.DoCreateFunctionNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DesignScriptStudio.Graph.Core.GraphController
的用法示例。
在下文中一共展示了GraphController.DoCreateFunctionNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDisableEdit
public void TestDisableEdit()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
VisualNode newNode = nodes[0] as VisualNode;
Assert.Throws<InvalidOperationException>(() =>
{
newNode.DisableEdit();
});
bool result = false;
newNode.EnableEdit(NodePart.Caption,-1);
result = newNode.DisableEdit();
Assert.AreEqual(true, result);
}
示例2: TestSlotType
public void TestSlotType()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "double,double");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
VisualNode node = (VisualNode)nodes[0];
uint slotId = node.GetInputSlot(0);
ISlot slot = ((GraphController)controller).GetSlot(slotId);
bool result = false;
if (slot.SlotType != SlotType.None)
result = true;
Assert.AreEqual(true, result);
}
示例3: TestOwners
public void TestOwners()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
VisualNode node = (VisualNode)nodes[0];
uint slotId = node.GetInputSlot(0);
ISlot slot = ((GraphController)controller).GetSlot(slotId);
bool result = false;
uint[] owners = slot.Owners;
if (owners.Count() != 0)
result = true;
Assert.AreEqual(true, result);
}
示例4: TestGetSlotPosition
public void TestGetSlotPosition()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
VisualNode node = ((VisualNode)nodes[0]);
uint slotId = node.GetOutputSlot(0);
ISlot slot = ((GraphController)controller).GetSlot(slotId);
System.Windows.Point pt = node.GetSlotPosition((Slot)slot);
bool result = false;
if (pt != null)
result = true;
Assert.AreEqual(true, result);
slot = null;
Assert.Throws<ArgumentNullException>(() =>
{
pt = node.GetSlotPosition((Slot)slot);
});
}
示例5: TestGetSlotIndex
public void TestGetSlotIndex()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
VisualNode node = ((VisualNode)nodes[0]);
uint slotId = node.GetInputSlot(0);
int result = node.GetSlotIndex(slotId);
Assert.AreEqual(0, result);
slotId = node.GetOutputSlot(0);
result = node.GetSlotIndex(slotId);
Assert.AreEqual(0, result);
//try to get index of a non-existent slot
Assert.Throws<InvalidOperationException>(() =>
{
result = node.GetSlotIndex(0x12345678);
});
}
示例6: TestGetOutputSlots
public void TestGetOutputSlots()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
uint[] list = nodes[0].GetOutputSlots();
int count = list.Count();
Assert.AreEqual(1, count);
}
示例7: TestGetOutputSlot
public void TestGetOutputSlot()
{
IGraphController controller = new GraphController(null);
controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");
List<IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
uint slotId = nodes[0].GetOutputSlot(0);
ISlot slot = ((GraphController)controller).GetSlot(slotId);
Assert.AreEqual(SlotType.Output, slot.SlotType);
}