public ProgressUpdateWrapper(IProgressUpdateInterface wrappedInterface) { if (wrappedInterface != null) { _wrappedInterfacePtr = Marshal.GetIUnknownForObjectInContext(wrappedInterface); } }
public void ConvertXml(XDocument doc, string outFileName, IProgressUpdateInterface progress) { LoadSettings(); _processorSettings.DeleteSource = false; var progressReporter = new ProgressUpdateWrapper(_processorSettings.ProgressCallbacks); progressReporter.ConvertStarted(1); IFb2EPubConverterEngine converter = CreateConverterEngine(_processorSettings.Settings); try { progressReporter.ProcessingStarted(outFileName); converter.LoadFB2FileFromXML(doc); } catch (Exception ex) { Logger.Log.Error(ex); return; } progressReporter.ProcessingSaving(outFileName); SaveAndCleanUp(converter, outFileName, ""); progressReporter.Processed(outFileName); progressReporter.ConvertFinished(0); }
public void ConvertList(string[] files, string outputFolder, IProgressUpdateInterface progress) { LoadSettings(); ProcessorSettings.Settings.OutPutPath = outputFolder; ProcessorSettings.ProgressCallbacks = progress; ProcessorSettings.Settings.ResourcesPath = GetResourcesPath(); PerformConvertOperation(files, null); }
public void SkippedDueError(string fileName) { if (_wrappedInterfacePtr != IntPtr.Zero) { IProgressUpdateInterface wrappedInterface = (IProgressUpdateInterface)Marshal.GetUniqueObjectForIUnknown(_wrappedInterfacePtr); wrappedInterface.SkippedDueError(fileName); } }
public void ProcessingSaving(string fileName) { if (_wrappedInterfacePtr != IntPtr.Zero) { IProgressUpdateInterface wrappedInterface = (IProgressUpdateInterface)Marshal.GetUniqueObjectForIUnknown(_wrappedInterfacePtr); wrappedInterface.ProcessingSaving(fileName); } }
public void ConvertFinished(int total) { if (_wrappedInterfacePtr != IntPtr.Zero) { IProgressUpdateInterface wrappedInterface = (IProgressUpdateInterface)Marshal.GetUniqueObjectForIUnknown(_wrappedInterfacePtr); wrappedInterface.ConvertFinished(total); } }
public void ConvertSingleFile(string inputPath, string outputName, IProgressUpdateInterface progress) { LoadSettings(); ProcessorSettings.ProgressCallbacks = progress; ProcessorSettings.Settings.ResourcesPath = GetResourcesPath(); ProcessorSettings.SingleFile = true; var filesInMask = new List <string> { inputPath }; bool conversionSucceeded = PerformConvertOperation(filesInMask, outputName); if (!conversionSucceeded) { throw new COMException("file conversion failed"); } }
public void ConvertPath(string inputPath, string outputFolder, IProgressUpdateInterface progress) { LoadSettings(); ProcessorSettings.ProgressCallbacks = progress; ProcessorSettings.Settings.OutPutPath = outputFolder; var fileParams = new List <string> { inputPath }; ProcessorSettings.LookInSubFolders = true; ProcessorSettings.Settings.ResourcesPath = GetResourcesPath(); var filesInMask = new List <string>(); DetectFilesToProcess(fileParams, ref filesInMask); PerformConvertOperation(filesInMask, null); }
public void ConvertSingleFile(string inputPath, string outputName, IProgressUpdateInterface progress) { LoadSettings(); ProcessorSettings.ProgressCallbacks = progress; ProcessorSettings.Settings.ResourcesPath = GetResourcesPath(); ProcessorSettings.SingleFile = true; var filesInMask = new List<string> {inputPath}; bool conversionSucceeded = PerformConvertOperation(filesInMask, outputName); if (!conversionSucceeded) { throw new COMException("file conversion failed"); } }
public void ConvertPath(string inputPath, string outputFolder, IProgressUpdateInterface progress) { LoadSettings(); ProcessorSettings.ProgressCallbacks = progress; ProcessorSettings.Settings.OutPutPath = outputFolder; var fileParams = new List<string> {inputPath}; ProcessorSettings.LookInSubFolders = true; ProcessorSettings.Settings.ResourcesPath = GetResourcesPath(); var filesInMask = new List<string>(); DetectFilesToProcess(fileParams, ref filesInMask); PerformConvertOperation(filesInMask, null); }