// ---------- ---------- ---------- ---------- ---------- ---------- // The following methods are used to search through the raw data // and compile the lists of first examples. They will be used // by the configuration form. // ---------- ---------- ---------- ---------- ---------- ---------- /// <summary> /// Search though everything to determine a complete list of first /// examples /// </summary> public void RunSearchAll() { string[] dirNamesArray = System.IO.Directory.GetDirectories(BasePathReader.GetBasePath() + StaticResources.baPath); string dirName = string.Empty; int currentYear = 0; m_listNumber = new List <FirstExampleType>(); m_listLocation = new List <FirstExampleType>(); // looping through years for (int index = 0; index < dirNamesArray.Count(); ++index) { dirName = dirNamesArray[index].Substring(dirNamesArray[index].LastIndexOf('\\') + 1); if (int.TryParse(dirName, out currentYear)) { string[] fileNamesArray = System.IO.Directory.GetFiles(dirNamesArray[index]); SearchThroughSingleYear(currentYear, fileNamesArray); } } FirstExampleIOController firstExampleController = FirstExampleIOController.GetInstance(); firstExampleController.WriteFileNumber(m_listNumber); firstExampleController.WriteFileLocation(m_listLocation); }
/// <summary> /// Search though everything to determine an annual list of first /// examples as determined by the year argument. /// </summary> /// <param name="year">year to search</param> public void RunSearchYear(string year) { int currentYear = 0; m_listNumber = new List <FirstExampleType>(); m_listLocation = new List <FirstExampleType>(); if (int.TryParse(year, out currentYear)) { string[] fileNamesArray = System.IO.Directory.GetFiles(BasePathReader.GetBasePath() + StaticResources.baPath + year); SearchThroughSingleYear(currentYear, fileNamesArray); } FirstExampleIOController firstExampleController = FirstExampleIOController.GetInstance(); firstExampleController.WriteFileNumber(m_listNumber, year); firstExampleController.WriteFileLocation(m_listLocation, year); }