示例#1
0
        public static void Export(IYAMLDocExportable @object, StreamWriter streamWriter, bool withMetaInfo)
        {
            YAMLWriter yamlWriter = new YAMLWriter();

            yamlWriter.IsWriteVersion    = withMetaInfo;
            yamlWriter.IsWriteDefaultTag = withMetaInfo;
            YAMLDocument document = @object.ExportYAMLDocument();

            yamlWriter.Add(document);
            yamlWriter.Write(streamWriter);
        }
示例#2
0
        public static void Export(IEnumerable <IYAMLDocExportable> objects, StreamWriter streamWriter, bool withMetaInfo)
        {
            YAMLWriter yamlWriter = new YAMLWriter();

            yamlWriter.IsWriteVersion    = withMetaInfo;
            yamlWriter.IsWriteDefaultTag = withMetaInfo;
            foreach (IYAMLDocExportable docExport in objects)
            {
                YAMLDocument document = docExport.ExportYAMLDocument();
                yamlWriter.Add(document);
            }
            yamlWriter.Write(streamWriter);
        }