public static string LoadArticle(string basePath, string articleFilePath) { try { var articleLoader = new ArticleLoader(); articleLoader.FilePath = Path.Combine(basePath, "Input", articleFilePath); articleLoader.Load(); return(articleLoader.Statements); } catch (Exception) { FindOrAddError("Err1", "Loading Artcile file failed."); } return(null); }
public T initLoader <T>(T repo) { if (repo == null) { object newInstance; Type t = typeof(T); switch (t.Name) { case "IAccountLoader": newInstance = new AccountLoader(RLoadr, _repoContext); break; case "IArticleLoader": newInstance = new ArticleLoader(RLoadr, _repoContext); break; case "IBlogLoader": newInstance = new BlogLoader(RLoadr, _repoContext); break; default: throw new RopoLoaderWrapperUnlistedException(typeof(T)); } return((T)newInstance); } return(repo); }