public static IResamplerDriver Load(string filePath) { string ext = Path.GetExtension(filePath).ToLower(); if (!File.Exists(filePath)) { return(null); } if (ext == ".exe") { return(new ExeDriver(filePath)); } if (ext == ".dll") { CppDriver cppDriver = new CppDriver(filePath); if (cppDriver.isLegalPlugin) { return(cppDriver); } SharpDriver csDriver = new SharpDriver(filePath); if (csDriver.isLegalPlugin) { return(csDriver); } } return(null); }
public static IResamplerDriver LoadEngine(string FilePath) { IResamplerDriver ret = null; if (System.IO.File.Exists(FilePath)) { if (Path.GetExtension(FilePath).ToLower() == ".exe") { ret = new ExeDriver(FilePath); } else if (Path.GetExtension(FilePath).ToLower() == ".dll") { CppDriver retcpp = new CppDriver(FilePath); if (retcpp.isLegalPlugin) { ret = retcpp; } else { SharpDriver retnet = new SharpDriver(FilePath); if (retnet.isLegalPlugin) { ret = retnet; } } } } return(ret); }