public void Export(IExportContainer container, Object asset, string path) { using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter streamWriter = new StreamWriter(fileStream)) { YAMLWriter writer = new YAMLWriter(); YAMLDocument doc = asset.ExportYAMLDocument(container); writer.AddDocument(doc); writer.Write(streamWriter); } } }
public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback) { using (FileStream fileStream = FileUtils.Open(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter streamWriter = new StreamWriter(fileStream)) { YAMLWriter writer = new YAMLWriter(); YAMLDocument doc = asset.ExportYAMLDocument(container); writer.AddDocument(doc); writer.Write(streamWriter); } } callback?.Invoke(container, asset, path); }
private void ExportYAML(IAssetsExporter exporter, Object asset, string path) { using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter streamWriter = new StreamWriter(fileStream)) { YAMLWriter writer = new YAMLWriter(); exporter.File = asset.File; YAMLDocument doc = asset.ExportYAMLDocument(exporter); writer.AddDocument(doc); writer.Write(streamWriter); } } }