public SearchInitializer(NameValueCollection configValues) { SearcherType = (FileSearcherTypes)Enum.Parse(typeof(FileSearcherTypes), configValues["searchBy"]); FromPath = configValues["fromDirectory"]; SearchedText = configValues["searchedText"]; FilesToSearch = configValues["fileInfo"].Split(';'); }
public SearchInitializer(IConfigurationRoot configuration) { SearcherType = SetSearcherType(configuration.GetSection("searchBy").Value); SearchedText = configuration.GetSection("searchedText")?.Value ?? throw new ArgumentNullException(_filedIsEmpty); FromPath = SetPath(configuration); FilesToSearch = SetFileNames(configuration); }
public SearchInitializer SetValues(string searchBy, string fileInfo, string searchedText, string fromPath) { FilesToSearch = SetFilesToSearch(fileInfo); SearcherType = SetSearcherType(searchBy); SearchedText = searchedText; FromPath = fromPath; return(this); }