/// <summary> /// Adds the document indicated by the specified path string to the project /// </summary> /// <param name="path">The path string of the document file to add to the project</param> /// /// <returns>An InputFile object which acts as a wrapper around the project relative path of the newly added file.</returns> public static InputFile AddFile(string path) { ThrowIfUninitialized(); var extension = Path.GetExtension(path).ToLower(); try { var originalFile = WrapperMap[extension](path); var newPath = extension == ".doc" ? DocFilesDirectory : extension == ".docx" ? DocxFilesDirectory : extension == ".txt" ? TxtFilesDirectory : extension == ".pdf" ? PdfFilesDirectory : extension == ".tagged" ? TaggedFilesDirectory : string.Empty; newPath += "\\" + originalFile.FileName; File.Copy(originalFile.FullPath, newPath, overwrite: true); var newFile = WrapperMap[extension](newPath); AddToTypedList(newFile as dynamic); return(newFile); } catch (UnsupportedFileTypeException e) { throw new UnsupportedFileTypeException(extension, e); } }
/// <summary> /// Private constructor to prevent object creation /// </summary> public JLogManager() { log4net.Config.XmlConfigurator.Configure(); s_wrapperMap = new WrapperMap(new WrapperCreationHandler(WrapperCreationHandler)); }
// Methods static MFAppLoggerManager() { s_wrapperMap = new WrapperMap(new WrapperCreationHandler(MFAppLoggerManager.WrapperCreationHandler)); }