public void RunExport() { IResourceManager manager = ServiceLocator.Current.GetInstance <IResourceManager>(); List <ExportMap> ListOfExports = (List <ExportMap>)manager.GetResourcePayload(ResourceName.Mapping_Export); foreach (ExportMap map in ListOfExports.Where(i => i.ExportTemplate != null)) { IExportTemplate Data = (IExportTemplate)Activator.CreateInstance(map.ExportTemplate); string Folderpath = FileLocations.EXPORT_FILES_FOLDER + map.Folder; if (Directory.Exists(Folderpath)) { Directory.Delete(Folderpath, true); } Directory.CreateDirectory(Folderpath); foreach (ExportFile exportFile in map.Files) { ExportPayload payload = Data.ProcessFile(Folderpath, exportFile); Writer writer = new Writer(payload); writer.WriteFile(); } } }
public Writer(ExportPayload Payload) { this._ExportPayload = Payload; }