本文整理汇总了C#中Dynamo.Nodes.DSFunction.UpdateValue方法的典型用法代码示例。如果您正苦于以下问题:C# DSFunction.UpdateValue方法的具体用法?C# DSFunction.UpdateValue怎么用?C# DSFunction.UpdateValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Nodes.DSFunction
的用法示例。
在下文中一共展示了DSFunction.UpdateValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBasicAttributes
public void TestBasicAttributes()
{
var sumNode = new DSFunction(ViewModel.Model.LibraryServices.GetFunctionDescriptor("+")) { X = 400, Y = 100 };
//Assert inital values
Assert.AreEqual(400, sumNode.X);
Assert.AreEqual(100, sumNode.Y);
Assert.AreEqual("+", sumNode.NickName);
Assert.AreEqual(LacingStrategy.Shortest, sumNode.ArgumentLacing);
Assert.AreEqual(true, sumNode.IsVisible);
Assert.AreEqual(true, sumNode.IsUpstreamVisible);
Assert.AreEqual(ElementState.Dead, sumNode.State);
//Serialize node and then change values
XmlDocument xmlDoc = new XmlDocument();
XmlElement serializedEl = sumNode.Serialize(xmlDoc, SaveContext.Undo);
sumNode.X = 250;
sumNode.Y = 0;
sumNode.NickName = "TestNode";
sumNode.UpdateValue(new UpdateValueParams("ArgumentLacing", "CrossProduct"));
sumNode.UpdateValue(new UpdateValueParams("IsVisible", "false"));
sumNode.UpdateValue(new UpdateValueParams("IsUpstreamVisible", "false"));
sumNode.State = ElementState.Active;
//Assert New Changes
Assert.AreEqual(250, sumNode.X);
Assert.AreEqual(0, sumNode.Y);
Assert.AreEqual("TestNode", sumNode.NickName);
Assert.AreEqual(LacingStrategy.CrossProduct, sumNode.ArgumentLacing);
Assert.AreEqual(false, sumNode.IsVisible);
Assert.AreEqual(false, sumNode.IsUpstreamVisible);
Assert.AreEqual(ElementState.Active, sumNode.State);
//Deserialize and Assert Old values
sumNode.Deserialize(serializedEl, SaveContext.Undo);
Assert.AreEqual(400, sumNode.X);
Assert.AreEqual(100, sumNode.Y);
Assert.AreEqual("+", sumNode.NickName);
Assert.AreEqual(LacingStrategy.Shortest, sumNode.ArgumentLacing);
Assert.AreEqual(true, sumNode.IsVisible);
Assert.AreEqual(true, sumNode.IsUpstreamVisible);
Assert.AreEqual(ElementState.Dead, sumNode.State);
}