public void Export(IExportContainer container, IEnumerable<Object> assets, string path) { using (FileStream fileStream = FileUtils.Open(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, new UTF8Encoding(false))) { YAMLWriter writer = new YAMLWriter(); writer.WriteHead(streamWriter); foreach (Object asset in assets) { YAMLDocument doc = asset.ExportYAMLDocument(container); writer.WriteDocument(doc); } writer.WriteTail(streamWriter); } } }
public bool Export(IExportContainer container, IEnumerable <Object> assets, string path) { using (Stream fileStream = FileUtils.CreateVirtualFile(path)) { using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, new UTF8Encoding(false))) { YAMLWriter writer = new YAMLWriter(); writer.WriteHead(streamWriter); foreach (Object asset in assets) { YAMLDocument doc = asset.ExportYAMLDocument(container); writer.WriteDocument(doc); } writer.WriteTail(streamWriter); } } return(true); }