public void AddDirectory(string path) { AssemblyRuleCatalog catalog = new AssemblyRuleCatalog(); DirectoryInfo directory = new DirectoryInfo(path); foreach(FileInfo file in directory.GetFiles()) { if(file.Extension.ToLower() == ".dll" || file.Extension.ToLower() == ".exe") { try { catalog.AddAssemblyFrom(file.FullName); } catch(Exception) {} } } foreach(IJudgeSql activeRule in catalog.ActiveRules) { AddActiveRule(activeRule); } }
public void AddDirectory(string path) { AssemblyRuleCatalog catalog = new AssemblyRuleCatalog(); DirectoryInfo directory = new DirectoryInfo(path); foreach (FileInfo file in directory.GetFiles()) { if (file.Extension.ToLower() == ".dll" || file.Extension.ToLower() == ".exe") { try { catalog.AddAssemblyFrom(file.FullName); } catch (Exception) {} } } foreach (IJudgeSql activeRule in catalog.ActiveRules) { AddActiveRule(activeRule); } }