本文整理汇总了C#中DesignScriptStudio.Graph.Core.GraphController.GetVisualNode方法的典型用法代码示例。如果您正苦于以下问题:C# GraphController.GetVisualNode方法的具体用法?C# GraphController.GetVisualNode怎么用?C# GraphController.GetVisualNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DesignScriptStudio.Graph.Core.GraphController
的用法示例。
在下文中一共展示了GraphController.GetVisualNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Defect_IDE_1670
public void Defect_IDE_1670()
{
string commands = @"CreateIdentifierNode|d:15339.0|d:15187.5
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateDriverNode|d:15422.0|d:15329.5
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15456.0|d:15335.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15307.0|d:15193.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
CreateIdentifierNode|d:15463.0|d:15206.5";
GraphController controller = new GraphController(null);
bool result00 = controller.RunCommands(commands);
Assert.AreEqual(true, result00);
VisualNode node;
node = (VisualNode)controller.GetVisualNode(0x10000001);
Assert.IsNullOrEmpty(node.ErrorMessage);
node = (VisualNode)controller.GetVisualNode(0x10000002);
Assert.IsNullOrEmpty(node.ErrorMessage);
node = (VisualNode)controller.GetVisualNode(0x10000003);
Assert.IsNullOrEmpty(node.ErrorMessage);
}
示例2: TestHandleClearSelection
public void TestHandleClearSelection()
{
string commands = @"
CreateFunctionNode|d:405.0|d:301.0|s:Math.dll|s:Math.Sin|s:double
CreateFunctionNode|d:746.0|d:267.0|s:Math.dll|s:Math.Sin|s:double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:548.0|d:325.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:754.0|d:288.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:353.0|d:199.0
SelectComponent|u:0x10000001|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000002|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000001|e:System.Windows.Input.ModifierKeys,None
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:926.0|d:409.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
ClearSelection";
GraphController graphController = new GraphController(null);
bool result = graphController.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = graphController.GetVisualNode(0x10000001);
IVisualNode node02 = graphController.GetVisualNode(0x10000002);
IVisualEdge edge = graphController.GetVisualEdge(0x60000001);
Assert.AreEqual(false, ((VisualNode)node01).Selected);
Assert.AreEqual(false, ((VisualNode)node02).Selected);
Assert.AreEqual(false, ((VisualEdge)edge).Selected);
}
示例3: Defect_IDE_1267
public void Defect_IDE_1267()
{
//create a '+' node, and identifier and a driver and then rename all of them using double click
// => verify the new names
string commands = @"
CreateFunctionNode|d:15427.0|d:15312.5|s:|s:+|s:double,double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:v1|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateIdentifierNode|d:15468.0|d:15204.0
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000002|s:v2|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateDriverNode|d:15432.0|d:15223.5
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None|d:15418.0|d:15219.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None|d:15330.0|d:15102.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
BeginNodeEdit|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000003|s:v3|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15363.0|d:15107.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15446.0|d:15206.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result00 = controller.RunCommands(commands);
Assert.AreEqual(true, result00);
VisualNode node = controller.GetVisualNode(0x10000001);
Assert.AreEqual("+", node.Caption);
Assert.AreEqual("v1", node.Text);
node = (VisualNode)controller.GetVisualNode(0x10000002);
Assert.AreEqual("v2", node.Caption);
node = (VisualNode)controller.GetVisualNode(0x10000003);
Assert.AreEqual("v3", node.Caption);
}
示例4: Defect_IDE_1533
public void Defect_IDE_1533()
{
// Create a simple file with CBN a = 1;
// Save it as : DesignScriptStudio.Tests\\UnitTests\\testfiles\\Defect_IDE_1533.bin
// Now try to open the file with the file name only ("Defect_IDE_1533.bin"); and verify
string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:15417.0|d:15222.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:a = 1;|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController graphController01 = new GraphController(null);
bool result = graphController01.RunCommands(commands);
Assert.AreEqual(true, result);
string testPath = "..\\..\\..\\..\\Studio\\DesignScriptStudio.Tests\\UnitTests\\testfiles\\";
string filePath = testPath + "Defect_IDE_1533.bin";
graphController01.DoSaveGraph(filePath);
GraphController graphController02 = new GraphController(null, filePath);
GraphController controller = new GraphController(null);
bool result00 = controller.RunCommands(commands);
Assert.AreEqual(true, result00);
VisualNode node = controller.GetVisualNode(0x10000001);
Assert.AreEqual(15417, node.X);
Assert.AreEqual(15222, node.Y);
Assert.AreEqual(false, node.Selected);
}
示例5: Cancel_Connection_1558
public void Cancel_Connection_1558()
{
//1. Create CBN a= Var3
//2. Create CBN 1
//3. create a function node Point.ByCoordiantes and connect the second CBN to points x,y, and z
string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:15378.0|d:15208.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:a=1|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateIdentifierNode|d:15519.0|d:15183.0
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15414.0|d:15212.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x00000000|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:-1.0|d:-1.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
VisualNode node = controller.GetVisualNode(0x10000002);
Assert.AreEqual(false, node.Selected);
}
示例6: T001_Defect_IDE_1319
public void T001_Defect_IDE_1319()
{
string commands = @"
CreateDriverNode|d:15409.0|d:15220.5
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None|d:15404.0|d:15226.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None|d:15466.0|d:15215.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:1|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
";
GraphController controller = new GraphController(null);
bool result00 = controller.RunCommands(commands);
Assert.AreEqual(true, result00);
VisualNode node;
node = (VisualNode)controller.GetVisualNode(0x10000001);
Assert.AreEqual(true, node.Error);
}
示例7: Defect_IDE_1387
public void Defect_IDE_1387()
{
// Error message is when there is no error in the code.
// create a Code Block with value "a=10;"
// create another Code Block with value "b=a;"
// After creating second Code Block error will pop up for variable 'a' hasn't been defined yet
string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:10343.0|d:10121.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:a=10;|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:10354.0|d:10201.0|s:
BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000002|s:b=a;|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = controller.GetVisualNode(0x10000001);// Code Block Node
IVisualNode node02 = controller.GetVisualNode(0x10000002);// Code Block Node
Assert.IsEmpty(node02.ErrorMessage);
// Check for Implicit connection
ISlot outputSlot = controller.GetSlot(0x30000001); // Output of CB Node.
Assert.IsNotNull(outputSlot);
ISlot inputSlot = controller.GetSlot(0x30000002); // Input slot of CB node.
Assert.IsNotNull(inputSlot);
// Output slot of first CB Node should connect to input slot second CB node.
uint[] connecting = outputSlot.ConnectingSlots;
Assert.IsNotNull(connecting);
Assert.IsTrue(connecting.Contains((uint)0x30000002));
}
示例8: Defect_IDE_1677
public void Defect_IDE_1677()
{
string commands = @"CreateIdentifierNode|d:15430.0|d:15290.5
CreateIdentifierNode|d:15387.0|d:15217.5
CreateIdentifierNode|d:15555.0|d:15123.0";
GraphController controller = new GraphController(null);
bool result00 = controller.RunCommands(commands);
Assert.AreEqual(true, result00);
VisualNode node;
node = (VisualNode)controller.GetVisualNode(0x10000001);
Assert.IsNullOrEmpty(node.ErrorMessage);
node = (VisualNode)controller.GetVisualNode(0x10000002);
Assert.IsNullOrEmpty(node.ErrorMessage);
node = (VisualNode)controller.GetVisualNode(0x10000003);
Assert.IsNullOrEmpty(node.ErrorMessage);
}
示例9: Defect_IDE_1239
public void Defect_IDE_1239()
{
// * [CRASH] Deleting a Node while in edit mode DSS is crashing.*
// Double click to start Code Block node. ( No need to type anything.)
// Now click on left side of Code Block node (inside node), to select it.
// You will observe that node is still in edit mode but you can select the node as well.
// Now press delete button or backspace key.
// Now click outside or else where in canvas.
// Above action will produces a crash.
string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:10502.0|d:10245.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:1|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node = controller.GetVisualNode(0x10000001);
commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:|b:False
DeleteComponents";
bool result01 = controller.RunCommands(commands);
Assert.IsTrue(result01);
Assert.AreEqual(0, controller.GetVisualNodes().Count());
}
示例10: CBNTestWithLastLineEmpty
public void CBNTestWithLastLineEmpty()
{
// Create CBN : a; and second line empty
string commands = @"
CreateCodeBlockNode|d:15475.0|d:15175.0|s:Your code goes here
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
EndNodeEdit|u:0x10000001|s:a;\n|b:True
";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node = controller.GetVisualNode(0x10000001);
Assert.NotNull(node); // Check if node is created
Assert.AreEqual(NodeType.CodeBlock, node.VisualType); // Check if node type is code block node
Assert.AreEqual(2, controller.GetSlots().Count); // Check if slot count is only 1
Assert.AreEqual("a;", ((CodeBlockNode)node).Text); // Check if text is 100
}
示例11: UndoRedoMove_TestRedoOfAllNodesBySelectingThemUsingWindowSelectionGeometryWorkflow
//.........这里部分代码省略.........
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000008|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000008|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:557.0|d:407.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None|d:628.0|d:361.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:752.0|d:360.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:888.0|d:399.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:740.0|d:546.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None|d:887.0|d:415.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:104.0|d:215.0
SelectComponent|u:0x10000001|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000002|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000003|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000004|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000005|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000006|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000007|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x10000008|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000001|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000002|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000003|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000004|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000005|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000006|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000007|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000008|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000009|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x6000000a|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x6000000b|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x6000000c|e:System.Windows.Input.ModifierKeys,None
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:965.0|d:681.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None|d:394.0|d:328.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None|d:1045.0|d:453.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = controller.GetVisualNode(0x10000001);// Surface
IVisualNode node02 = controller.GetVisualNode(0x10000002);// Circle
IVisualNode node03 = controller.GetVisualNode(0x10000003);// Line
IVisualNode node04 = controller.GetVisualNode(0x10000004);// Point
IVisualNode node05 = controller.GetVisualNode(0x10000005);// Point
IVisualNode node06 = controller.GetVisualNode(0x10000006);// CodeBlock (0)
IVisualNode node07 = controller.GetVisualNode(0x10000007);// CodeBlock (10)
IVisualNode node08 = controller.GetVisualNode(0x10000008);// CodeBlock (1)
double X = node01.X;
double Y = node01.Y;
double X1 = node02.X;
double Y1 = node02.Y;
double X2 = node03.X;
double Y2 = node03.Y;
double X3 = node04.X;
double Y3 = node04.Y;
double X4 = node05.X;
double Y4 = node05.Y;
double X5 = node06.X;
double Y5 = node06.Y;
double X6 = node07.X;
double Y6 = node07.Y;
double X7 = node08.X;
double Y7 = node08.Y;
commands = @"
UndoOperation
RedoOperation";
bool result02 = controller.RunCommands(commands);
Assert.AreEqual(true, result02);
Assert.AreEqual(X, node01.X);
Assert.AreEqual(Y, node01.Y);
Assert.AreEqual(X1, node02.X);
Assert.AreEqual(Y1, node02.Y);
Assert.AreEqual(X2, node03.X);
Assert.AreEqual(Y2, node03.Y);
Assert.AreEqual(X3, node04.X);
Assert.AreEqual(Y3, node04.Y);
Assert.AreEqual(X4, node05.X);
Assert.AreEqual(Y4, node05.Y);
Assert.AreEqual(X5, node06.X);
Assert.AreEqual(Y5, node06.Y);
Assert.AreEqual(X6, node07.X);
Assert.AreEqual(Y6, node07.Y);
Assert.AreEqual(X7, node08.X);
Assert.AreEqual(Y7, node08.Y);
Assert.AreEqual("0;", ((CodeBlockNode)node06).Text); // Check if text is 0
Assert.AreEqual("10;", ((CodeBlockNode)node07).Text);// Check if text is 10
Assert.AreEqual("1;", ((CodeBlockNode)node08).Text);// Check if text is 1
Assert.AreEqual(8, controller.GetVisualNodes().Count);
}
示例12: UndoRedoMove_TestRedoOfDriverNodeMove
public void UndoRedoMove_TestRedoOfDriverNodeMove()
{
// Create Add Node and move it to new position.
// Do undo.
// Do Redo
string commands = @"
CreateDriverNode|d:10633.0|d:10295.0";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = controller.GetVisualNode(0x10000001);// Add Node
Assert.AreEqual(NodeType.Driver, node01.VisualType); // Check if node type is CodeBlock node
double X = node01.X;
double Y = node01.Y;
commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None|d:10688.0|d:10306.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None|d:10888.0|d:10570.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None";
bool result01 = controller.RunCommands(commands);
Assert.AreEqual(true, result01);
Assert.AreEqual(NodeType.Driver, node01.VisualType); // Check if node type is Driver node
double X1 = node01.X;
double Y1 = node01.Y;
commands = @"
UndoOperation";
bool result02 = controller.RunCommands(commands);
Assert.AreEqual(true, result02);
Assert.AreEqual(NodeType.Driver, node01.VisualType); // Check if node type is Driver node
Assert.AreEqual(X, node01.X);
Assert.AreEqual(Y, node01.Y);
commands = @"
RedoOperation";
bool result03 = controller.RunCommands(commands);
Assert.AreEqual(true, result03);
Assert.AreEqual(NodeType.Driver, node01.VisualType); // Check if node type is Driver node
Assert.AreEqual(X1, node01.X);
Assert.AreEqual(Y1, node01.Y);
Assert.AreEqual(1, controller.GetVisualNodes().Count);
}
示例13: UndoRedoMove_TestNodeDeletionAfterMoveAndThenRedoEverything
public void UndoRedoMove_TestNodeDeletionAfterMoveAndThenRedoEverything()
{
// Create two code block nodes.
// Create one Add node.
// Connect both CodeBlock nodes to Add node.
// Move second CodeBlock node to new position.
// Delete moved node.
// Do undo.
// Do Undo.
// Do Redo.
// Do Redo.
string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:373.0|d:138.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:97|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:409.0|d:286.0|s:
BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000002|s:61|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateFunctionNode|d:633.0|d:205.0|s:|s:Add|s:double,double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:398.0|d:150.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:635.0|d:218.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:436.0|d:299.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None|d:638.0|d:231.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:426.0|d:300.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:544.0|d:463.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = controller.GetVisualNode(0x10000001);// CodeBlock Node
IVisualNode node02 = controller.GetVisualNode(0x10000002);// CodeBlock Node
IVisualNode node03 = controller.GetVisualNode(0x10000003);// Max Node
double X1 = node02.X;
double Y1 = node02.Y;
commands = @"
DeleteComponents
UndoOperation
UndoOperation
RedoOperation";
bool result02 = controller.RunCommands(commands);
Assert.AreEqual(true, result02);
Assert.AreEqual(X1, node02.X);
Assert.AreEqual(Y1, node02.Y);
ISlot outputSlot = controller.GetSlot(0x30000002); // Output of first CodeBlock ndoe.
Assert.IsNotNull(outputSlot);
ISlot inputSlot = controller.GetSlot(0x30000004); // First Input of Add Node.
Assert.IsNotNull(inputSlot);
// Output slot CoedBlock Node should connect to input slot Max node.
uint[] connecting = outputSlot.ConnectingSlots;
Assert.IsNotNull(connecting);
Assert.IsTrue(connecting.Contains((uint)0x30000004));
Assert.AreEqual("97;", ((CodeBlockNode)node01).Text); // Check if text is 97
Assert.AreEqual("61;", ((CodeBlockNode)node02).Text);// Check if text is 61
Assert.AreEqual(3, controller.GetVisualNodes().Count);
commands = @"RedoOperation";
bool result03 = controller.RunCommands(commands);
Assert.AreEqual(true, result03);
Assert.AreEqual(2, controller.GetVisualNodes().Count);
}
示例14: RedoRepositionAndDeletionOfNodesAndConnectionLines
public void RedoRepositionAndDeletionOfNodesAndConnectionLines()
{
// Create Min Node from Math
// Create Two Code block node by typing any values.
// Connect Both code block nodes to input slots of Min node.
// Move Min node, and also move both Code block nodes.
// Now delete Both connection lines.(window selection)
// Undo all
// Redo all
string commands = @"
CreateFunctionNode|d:622.0|d:208.0|s:Math.dll|s:Math.Min|s:double,double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:372.0|d:177.0|s:
BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000002|s:10|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:371.0|d:249.0|s:
BeginNodeEdit|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:0|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000003|s:20|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:395.0|d:190.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:628.0|d:220.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:394.0|d:264.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None|d:628.0|d:234.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:387.0|d:191.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:392.0|d:154.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:386.0|d:265.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:391.0|d:307.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None|d:669.0|d:221.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None|d:619.0|d:227.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:515.0|d:354.0
SelectComponent|u:0x60000001|e:System.Windows.Input.ModifierKeys,None
SelectComponent|u:0x60000002|e:System.Windows.Input.ModifierKeys,None
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:495.0|d:124.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
DeleteComponents
UndoOperation
UndoOperation
UndoOperation
UndoOperation
UndoOperation
UndoOperation
RedoOperation
RedoOperation
RedoOperation
RedoOperation
RedoOperation";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node01 = controller.GetVisualNode(0x10000001);
IVisualNode node02 = controller.GetVisualNode(0x10000002);
IVisualNode node03 = controller.GetVisualNode(0x10000003);
ISlot outputSlot = controller.GetSlot(0x30000004); // Output 0x10000002
Assert.IsNotNull(outputSlot);
ISlot inputSlot = controller.GetSlot(0x30000001); // Input 0x10000001
Assert.IsNotNull(inputSlot);
// Output slot 0x10000002 should connect to input slot 0x10000001.
uint[] connecting = outputSlot.ConnectingSlots;
Assert.IsNotNull(connecting);
Assert.AreEqual(0x30000001, connecting[0]);
ISlot outputSlot1 = controller.GetSlot(0x30000005); // Output 0x10000002
Assert.IsNotNull(outputSlot);
ISlot inputSlot1 = controller.GetSlot(0x30000002); // Input 0x10000001
Assert.IsNotNull(inputSlot1);
// Output slot 0x10000003 should connect to input slot 0x10000001.
uint[] connecting1 = outputSlot1.ConnectingSlots;
Assert.IsNotNull(connecting);
Assert.AreEqual(0x30000002, connecting1[0]);
Assert.AreEqual(3, controller.GetVisualNodes().Count); //Check if node count is 3
Assert.NotNull(new object[] { node01, node02, node03 }); // Check if node is created
Assert.AreEqual(NodeType.Function, node01.VisualType); // Check if node type is Function node
Assert.AreEqual(NodeType.CodeBlock, node02.VisualType); // Check if node type is Code block node
Assert.AreEqual(NodeType.CodeBlock, node03.VisualType); // Check if node type is Code block node
}
示例15: RedoIdentifierNodeCreation
public void RedoIdentifierNodeCreation()
{
// Create IdentifierNode
// Undo craetion of IdentifierNode (Using Ctrl+Z)
// Redo IdentifierNode creation.(Using Ctrl+Y)
// Currently it is crashing while doing above steps manually and defect logged for this. (http://adsk-oss.myjetbrains.com/youtrack/issue/IDE-956)
string commands = @"
CreateIdentifierNode|d:647.0|d:184.0
UndoOperation
RedoOperation";
GraphController controller = new GraphController(null);
bool result = controller.RunCommands(commands);
Assert.AreEqual(true, result);
IVisualNode node = controller.GetVisualNode(0x10000001);
Assert.NotNull(node); // Check if node is created
Assert.AreEqual(NodeType.Identifier, node.VisualType); // Check if node type is code block node
}