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


C# IStorage.WriteDouble方法代码示例

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

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


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