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


C# GraphController.DoCreateFunctionNode方法代码示例

本文整理汇总了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);
        }
开发者ID:samuto,项目名称:designscript,代码行数:17,代码来源:VisualNodeTests.cs

示例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);
        }
开发者ID:samuto,项目名称:designscript,代码行数:14,代码来源:SlotTests.cs

示例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);
        }
开发者ID:samuto,项目名称:designscript,代码行数:18,代码来源:SlotTests.cs

示例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);
            });
        }
开发者ID:samuto,项目名称:designscript,代码行数:23,代码来源:VisualNodeTests.cs

示例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);
            });
        }
开发者ID:samuto,项目名称:designscript,代码行数:22,代码来源:VisualNodeTests.cs

示例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);
        }
开发者ID:samuto,项目名称:designscript,代码行数:10,代码来源:VisualNodeTests.cs

示例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);
        }
开发者ID:samuto,项目名称:designscript,代码行数:10,代码来源:VisualNodeTests.cs


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