예제 #1
0
 public SearchInitializer(NameValueCollection configValues)
 {
     SearcherType  = (FileSearcherTypes)Enum.Parse(typeof(FileSearcherTypes), configValues["searchBy"]);
     FromPath      = configValues["fromDirectory"];
     SearchedText  = configValues["searchedText"];
     FilesToSearch = configValues["fileInfo"].Split(';');
 }
예제 #2
0
 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);
 }
예제 #3
0
        public SearchInitializer SetValues(string searchBy, string fileInfo, string searchedText, string fromPath)
        {
            FilesToSearch = SetFilesToSearch(fileInfo);
            SearcherType  = SetSearcherType(searchBy);
            SearchedText  = searchedText;
            FromPath      = fromPath;

            return(this);
        }