本文整理汇总了C#中IStorage.WriteDouble方法的典型用法代码示例。如果您正苦于以下问题:C# IStorage.WriteDouble方法的具体用法?C# IStorage.WriteDouble怎么用?C# IStorage.WriteDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStorage
的用法示例。
在下文中一共展示了IStorage.WriteDouble方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public bool Serialize(IStorage storage)
{
if (storage == null)
throw new ArgumentNullException("storage");
try
{
storage.WriteUnsignedInteger(FieldCode.EdgeSignature, Configurations.EdgeSignature);
storage.WriteInteger(FieldCode.EdgeType, (int)this.EdgeType);
storage.WriteInteger(FieldCode.EdgeVersion, (int)VisualEdge.Version.Current);
storage.WriteUnsignedInteger(FieldCode.EdgeId, this.EdgeId);
storage.WriteInteger(FieldCode.EdgeState, (int)this.edgeState);
storage.WriteUnsignedInteger(FieldCode.StartSlotId, this.StartSlotId);
storage.WriteUnsignedInteger(FieldCode.EndSlotId, this.EndSlotId);
storage.WriteInteger(FieldCode.ControlPointsCount, this.controlPoints.Count);
foreach (Point pt in this.controlPoints)
{
storage.WriteDouble(FieldCode.ControlPointsX, pt.X);
storage.WriteDouble(FieldCode.ControlPointsY, pt.Y);
}
return true;
}
catch (Exception e)
{
Console.WriteLine(e.Message + "\n Edge serialization failed.");
return false;
}
}
示例2: Serialize
public virtual bool Serialize(IStorage storage)
{
if (storage == null)
throw new ArgumentNullException("storage");
try
{
storage.WriteUnsignedInteger(FieldCode.NodeSignature, Configurations.NodeSignature);
storage.WriteInteger(FieldCode.NodeType, (int)this.nodeType);
storage.WriteInteger(FieldCode.NodeVersion, (int)VisualNode.Version.Current);
storage.WriteUnsignedInteger(FieldCode.NodeId, this.nodeId);
storage.WriteInteger(FieldCode.NodeState, (int)this.nodeState);
storage.WriteString(FieldCode.Text, this.Text);
storage.WriteString(FieldCode.Caption, this.Caption);
storage.WriteDouble(FieldCode.NodePositionX, this.nodePosition.X);
storage.WriteDouble(FieldCode.NodePositionY, this.nodePosition.Y);
storage.WriteInteger(FieldCode.InputSlotsCount, this.inputSlots.Count);
foreach (uint i in this.inputSlots)
storage.WriteUnsignedInteger(FieldCode.InputSlots, i);
storage.WriteInteger(FieldCode.OutputSlotsCount, this.outputSlots.Count);
foreach (uint j in this.outputSlots)
storage.WriteUnsignedInteger(FieldCode.OutputSlots, j);
return true;
}
catch (Exception e)
{
Console.WriteLine(e.Message + "\n Visual node serialization failed.");
return false;
}
}