本文整理汇总了C#中Dynamo.Models.NodeModel.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# NodeModel.GetValue方法的具体用法?C# NodeModel.GetValue怎么用?C# NodeModel.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Models.NodeModel
的用法示例。
在下文中一共展示了NodeModel.GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunTest
public override bool RunTest(NodeModel node, StreamWriter writer)
{
bool pass = false;
var valueMap = new Dictionary<Guid, String>();
if (node.OutPorts.Count > 0)
{
Guid guid = node.GUID;
Object data = node.GetValue(0).Data;
String val = data != null ? data.ToString() : "null";
valueMap.Add(guid, val);
writer.WriteLine(guid + " :: " + val);
writer.Flush();
}
int numberOfUndosNeeded = Mutate(node);
Thread.Sleep(100);
writer.WriteLine("### - Beginning undo");
for (int iUndo = 0; iUndo < numberOfUndosNeeded; iUndo++)
{
DynamoViewModel.UIDispatcher.Invoke(new Action(() =>
{
DynamoViewModel.UndoRedoCommand undoCommand =
new DynamoViewModel.UndoRedoCommand(
DynamoViewModel.UndoRedoCommand.Operation.Undo);
DynamoViewModel.ExecuteCommand(undoCommand);
}));
Thread.Sleep(100);
}
writer.WriteLine("### - undo complete");
writer.Flush();
writer.WriteLine("### - undo complete");
writer.Flush();
writer.WriteLine("### - Beginning re-exec");
DynamoViewModel.UIDispatcher.Invoke(new Action(() =>
{
DynamoViewModel.RunCancelCommand runCancel =
new DynamoViewModel.RunCancelCommand(false, false);
DynamoViewModel.ExecuteCommand(runCancel);
}));
Thread.Sleep(10);
while (DynamoViewModel.Model.Runner.Running)
{
Thread.Sleep(10);
}
writer.WriteLine("### - re-exec complete");
writer.Flush();
writer.WriteLine("### - Beginning readback");
writer.WriteLine("### - Beginning test of String");
if (node.OutPorts.Count > 0)
{
try
{
String valmap = valueMap[node.GUID].ToString();
Object data = node.GetValue(0).Data;
String nodeVal = data != null ? data.ToString() : "null";
if (valmap != nodeVal)
{
writer.WriteLine("!!!!!!!!!!! - test of String is failed");
writer.WriteLine(node.GUID);
writer.WriteLine("Was: " + nodeVal);
writer.WriteLine("Should have been: " + valmap);
writer.Flush();
return pass;
}
}
catch (Exception)
{
writer.WriteLine("!!!!!!!!!!! - test of String is failed");
writer.Flush();
return pass;
}
}
writer.WriteLine("### - test of Number complete");
writer.Flush();
return pass = true;
}