public Component[] LoadComponents(string dirPath) { // set search method of this (host for components being loaded) SearchMethod = new ComponentSearchDirectory(dirPath); List <Component> components = new List <Component>(); DirectoryInfo dirInfo = new DirectoryInfo(dirPath); foreach (FileInfo fileInfo in dirInfo.GetFiles()) { Component component = LoadComponent(fileInfo.FullName); if (null != component) { components.Add(component); } } return(components.ToArray()); }
public Component[] LoadComponents(string dirPath) { // set search method of this (host for components being loaded) SearchMethod = new ComponentSearchDirectory(dirPath); List<Component> components = new List<Component>(); DirectoryInfo dirInfo = new DirectoryInfo(dirPath); foreach (FileInfo fileInfo in dirInfo.GetFiles()) { Component component = LoadComponent(fileInfo.FullName); if (null != component) components.Add(component); } return components.ToArray(); }