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


C# IStorage.WriteString方法代码示例

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


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

示例1: Serialize

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

            try
            {
                base.Serialize(storage);
                storage.WriteString(FieldCode.Assembly, this.Assembly);
                storage.WriteString(FieldCode.QualifiedName, this.QualifiedName);
                storage.WriteString(FieldCode.ArgumentTypes, this.ArgumentTypes);
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n Identifier node serialization failed.");
                return false;
            }
        }
开发者ID:samuto,项目名称:designscript,代码行数:19,代码来源:PropertyNode.cs

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

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

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

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

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

示例7: Serialize

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

            try
            {
                base.Serialize(storage);
                storage.WriteString(FieldCode.Assembly, this.Assembly);
                storage.WriteString(FieldCode.QualifiedName, this.QualifiedName);
                storage.WriteString(FieldCode.ArgumentTypes, this.ArgumentTypes);

                // Take for example, this case:
                //
                //      foo(a<8><9>, b, c<7>)
                //
                // The serialized replication guides would be as follow:
                //
                //      [RAC|3][RIC|2][RI|8][RI|9][RIC|0][RIC|1][RI|7]
                //
                // Where:
                //
                //      RAC = FieldCode.ReplicationArgumentCount
                //      RIC = FieldCode.ReplicationIndexCount
                //      RI  = FieldCode.ReplicationIndex
                //
                storage.WriteInteger(FieldCode.ReplicationArgumentCount, this.replicationGuides.Count);
                foreach (List<int> list in replicationGuides)
                {
                    storage.WriteInteger(FieldCode.ReplicationIndexCount, list.Count);
                    foreach (int value in list)
                        storage.WriteInteger(FieldCode.ReplicationIndex, value);
                }

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

示例8: Serialize

        public override bool Serialize(IStorage storage)
        {
            if (storage == null)
                throw new ArgumentNullException("storage");
            try
            {
                base.Serialize(storage);
                storage.WriteString(FieldCode.CompilableText, this.compilableText);

                storage.WriteInteger(FieldCode.InputLinesCount, this.inputLines.Count);
                foreach (KeyValuePair<int, List<VariableLine>> kvp in this.inputLines)
                {
                    storage.WriteInteger(FieldCode.StatmentIndex, kvp.Key);
                    storage.WriteInteger(FieldCode.VariableLineCount, kvp.Value.Count);
                    foreach (VariableLine variableLine in kvp.Value)
                    {
                        storage.WriteString(FieldCode.Variable, variableLine.variable);
                        storage.WriteInteger(FieldCode.Line, variableLine.line);
                    }
                }

                storage.WriteInteger(FieldCode.OutputLinesCount, this.outputLines.Count);
                foreach (VariableLine variableLine in this.outputLines)
                {
                    storage.WriteString(FieldCode.Variable, variableLine.variable);
                    storage.WriteInteger(FieldCode.Line, variableLine.line);
                }

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


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