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


C# IStorage.WriteUnsignedInteger方法代码示例

本文整理汇总了C#中IStorage.WriteUnsignedInteger方法的典型用法代码示例。如果您正苦于以下问题:C# IStorage.WriteUnsignedInteger方法的具体用法?C# IStorage.WriteUnsignedInteger怎么用?C# IStorage.WriteUnsignedInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IStorage的用法示例。


在下文中一共展示了IStorage.WriteUnsignedInteger方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

        public override bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            try
            {
                base.Serialize(storage);

                storage.WriteInteger(FieldCode.EmbeddedNodesCount, this.embeddedNodes.Count);
                foreach (uint i in this.embeddedNodes)
                    storage.WriteUnsignedInteger(FieldCode.EmbeddedNode, i);

                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n Condensed node serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:21,代码来源:CondensedNode.cs

示例2: Serialize

        public bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            try
            {
                storage.WriteUnsignedInteger(FieldCode.SlotSignature, Configurations.SlotSignature);
                storage.WriteInteger(FieldCode.SlotType, (int)this.slotType);
                storage.WriteInteger(FieldCode.SlotVersion, (int)Slot.Version.Current);
                storage.WriteUnsignedInteger(FieldCode.SlotId, this.slotId);
                storage.WriteInteger(FieldCode.SlotState, (int)this.slotState);

                storage.WriteInteger(FieldCode.OwnersCount, this.owners.Count);
                foreach (uint i in this.owners)
                    storage.WriteUnsignedInteger(FieldCode.Owners, i);

                storage.WriteInteger(FieldCode.ConnectingSlotsCount, this.connectingSlots.Count);
                foreach (uint j in this.connectingSlots)
                    storage.WriteUnsignedInteger(FieldCode.ConnectingSlots, j);

                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n Slot serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:29,代码来源:Slot.cs

示例3: RecordNodeIds

        private void RecordNodeIds(IStorage storage, List<IVisualNode> nodeList, UserAction userAction)
        {
            DataHeader header = new DataHeader();
            header.DataSize = Configurations.UndoReDoDataHeaderSize;
            long initialPosition = storage.GetPosition();

            //Record the number of nodes and the nodeIds
            storage.WriteInteger(FieldCode.NodeCount, nodeList.Count);
            foreach (IVisualNode node in nodeList)
            {
                header.Serialize(storage);
                storage.WriteUnsignedInteger(FieldCode.NodeId, node.NodeId);
            }

            this.RecordFlag(storage, initialPosition, userAction);
        }
开发者ID:samuto,项目名称:designscript,代码行数:16,代码来源:UndoRedoRecorder.cs

示例4: 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

示例5: WriteVariableSlotInfo

 private bool WriteVariableSlotInfo(IStorage storage, VariableSlotInfo variableSlotInfo)
 {
     storage.WriteString(FieldCode.VariableSlotInfoVar, variableSlotInfo.Variable);
     storage.WriteInteger(FieldCode.VariableSlotInfoLine, variableSlotInfo.Line);
     storage.WriteUnsignedInteger(FieldCode.VariableSlotInfoSlotId, variableSlotInfo.SlotId);
     return true;
 }
开发者ID:samuto,项目名称:designscript,代码行数:7,代码来源:Statement.cs

示例6: RecordEdgeIds

        private void RecordEdgeIds(IStorage storage, List<IVisualEdge> edgeList, UserAction userAction)
        {
            DataHeader header = new DataHeader();
            header.DataSize = 12;
            long initialPosition = storage.GetPosition();

            //Record the number of edges and the edgeIds
            storage.WriteInteger(FieldCode.EdgeCount, edgeList.Count);
            foreach (IVisualEdge edge in edgeList)
            {
                header.Serialize(storage);
                storage.WriteUnsignedInteger(FieldCode.EdgeId, edge.EdgeId);
            }

            this.RecordFlag(storage, initialPosition, userAction);
        }
开发者ID:samuto,项目名称:designscript,代码行数:16,代码来源:UndoRedoRecorder.cs

示例7: Serialize

        public virtual bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            storage.WriteUnsignedInteger(FieldCode.StatementSignature, Configurations.StatementSignature);
            storage.WriteInteger(FieldCode.StatementFlag, (int)this.flags);
            storage.WriteString(FieldCode.DefinedVariable, this.definedVariable);
            WriteVariableSlotInfo(storage, this.outputExpression);

            storage.WriteInteger(FieldCode.ReferencesCount, this.references.Count);
            foreach (VariableSlotInfo reference in this.references)
                WriteVariableSlotInfo(storage, reference);

            // @TODO(Sean): Write Serialize/Deserialize test cases with and without children.
            storage.WriteInteger(FieldCode.ChildrenCount, this.children.Count);
            foreach (Statement childStatement in this.children)
                childStatement.Serialize(storage);

            return true;
        }
开发者ID:samuto,项目名称:designscript,代码行数:21,代码来源:Statement.cs

示例8: Serialize

        public bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            try
            {
                storage.WriteUnsignedInteger(FieldCode.RuntimeStatesSignature, Configurations.RuntimeStatesSignature);
                storage.WriteInteger(FieldCode.RuntimeStatesVersion, (int)(RuntimeStates.Version.Current));
                storage.WriteBoolean(FieldCode.IsModified, this.IsModified);

                storage.WriteInteger(FieldCode.VariableNodesMapCount, this.variableNodesMap.Count);
                foreach (KeyValuePair<string, List<uint>> kvp in this.variableNodesMap)
                {
                    storage.WriteString(FieldCode.VariableNodesMapKey, kvp.Key);
                    List<uint> values = kvp.Value.ToList<uint>();
                    storage.WriteInteger(FieldCode.VariableNodesMapValueCount, values.Count);
                    foreach (uint value in values)
                        storage.WriteUnsignedInteger(FieldCode.VariableNodesMapValue, value);
                }

                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n RuntimeStates serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:29,代码来源:RuntimeStates.cs

示例9: Serialize

        public bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            try
            {
                long before = storage.GetPosition();
                storage.WriteUnsignedInteger(FieldCode.DataHeaderSignature, Configurations.DataHeaderSignature);
                storage.WriteInteger(FieldCode.DataHeaderVersion, (int)DataHeader.Version.Current);
                storage.WriteLong(FieldCode.HeaderSize, this.HeaderSize);
                storage.WriteLong(FieldCode.DataSize, this.DataSize);
                long after = storage.GetPosition();

                // Ensuring the header size agrees with what we say it is.
                System.Diagnostics.Debug.Assert((after - before) == this.HeaderSize);
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n Data header serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:24,代码来源:DataHeader.cs

示例10: 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

示例11: Serialize

        public bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");

            try
            {
                storage.WriteUnsignedInteger(FieldCode.GraphPropertiesSignature, Configurations.GraphPropertiesSignature);
                storage.WriteInteger(FieldCode.GraphPropertiesVersion, (int)(GraphProperties.Version.Current));
                storage.WriteString(FieldCode.ApplicationVersion, this.ApplicationVersion);
                storage.WriteString(FieldCode.AuthorName, this.AuthorName);
                storage.WriteString(FieldCode.CompanyName, this.CompanyName);

                storage.WriteInteger(FieldCode.ImportedScriptsCount, this.ImportedScripts.Count);
                foreach (string importedScript in this.ImportedScripts)
                    storage.WriteString(FieldCode.ImportedScript, importedScript);

                this.RuntimeStates.Serialize(storage);
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n GraphProperties serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:26,代码来源:GraphProperties.cs


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