Beispiel #1
0
        public string GetSerializationString(string fieldInstance, string schemaObject, uint fieldNumber, int indents)
        {
            var codeWriter = new CodeWriter();

            codeWriter.WriteLine($"foreach (var value in {fieldInstance})");
            using (codeWriter.Scope())
            {
                codeWriter.WriteLine(containedType.GetSerializationStatement("value", schemaObject, fieldNumber));
            }

            return(CommonGeneratorUtils.IndentEveryNewline(codeWriter.Build(), indents));
        }
Beispiel #2
0
        public string GetSerializationString(string fieldInstance, string schemaObject, uint fieldNumber, int indents)
        {
            var codeWriter = new CodeWriter();

            codeWriter.WriteLine($"foreach (var keyValuePair in {fieldInstance})");
            using (codeWriter.Scope())
            {
                codeWriter.WriteLine($"var mapObj = {schemaObject}.AddObject({fieldNumber});");
                codeWriter.WriteLine(keyType.GetSerializationStatement("keyValuePair.Key", "mapObj", 1));
                codeWriter.WriteLine(valueType.GetSerializationStatement("keyValuePair.Value", "mapObj", 2));
            }

            return(CommonGeneratorUtils.IndentEveryNewline(codeWriter.Build(), indents));
        }
Beispiel #3
0
 public string GetSerializationString(string fieldInstance, string schemaObject, uint fieldNumber, int indents)
 {
     return(containedType.GetSerializationStatement(fieldInstance, schemaObject, fieldNumber));
 }