/// <summary> /// Get helper for processing a document, based on document extension /// </summary> /// <param name="path">Source document full path</param> /// <returns></returns> private static DocumentHelper GetHelperForDocument(String path) { DocumentHelper helper = null; FileInfo fi = new FileInfo(path); String ext = fi.Extension.Substring(1).ToLower(); if (ext.Equals("docx")) { helper = new WordDocumentHelper(); } else if (ext.Equals("xlsx")) { helper = new ExcelDocumentHelper(); } else if (ext.Equals("pptx")) { helper = new PowerPointDocumentHelper(); } else if (ext.Equals("jpeg") || ext.Equals("jpg") || ext.Equals("png") || ext.Equals("bmp") || ext.Equals("gif") || ext.Equals("tiff")) { helper = new PictureDocumentHelper(); } else { if (TextHighlightConfiguration.GetTextHighlightForTextFile(path) != null) { helper = new TextDocumentHelper(); } } return helper; }
/// <summary> /// Need to be removed, not used anymore /// </summary> /// <param name="path"></param> /// <returns></returns> public static Document LoadExistingDocument(String path) { DocumentHelper helper = new ExcelDocumentHelper(); Document document = null; return document; }