Beispiel #1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            if (HasCurrentChannels(container.ExportVersion))
            {
                node.Add(CurrentChannelsName, CurrentChannels);
            }
            node.Add(VertexCountName, VertexCount);

            if (HasChannels(container.ExportVersion))
            {
                node.Add(ChannelsName, Channels.ExportYAML(container));
            }
            if (HasStreams(container.ExportVersion))
            {
                if (IsStreamStatic(container.ExportVersion))
                {
                    for (int i = 0; i < StaticStreamCount; i++)
                    {
                        node.Add($"{StreamsName}[{i}]", Streams[i].ExportYAML(container));
                    }
                }
                else
                {
                    node.Add(StreamsName, Streams.ExportYAML(container));
                }
            }

            node.Add(DataSizeName, Data.Length);
            node.Add(Object.TypelessdataName, Data.ExportYAML());
            return(node);
        }