public void Check() { try { using (FileStream fs = Info.OpenRead()) { try { using (StreamReader sr = new StreamReader(fs)) { Line = sr.ReadLine(); } } catch (System.OutOfMemoryException) { throw; } catch (System.ArgumentNullException) { throw; } catch (System.ArgumentException) { throw; } } } catch (DirectoryNotFoundException) { throw; } catch (IOException) { throw; } catch (System.UnauthorizedAccessException) { throw; } try { Match match = Rx.Match(Line); MachNumFromFile = match.Groups[1].Value; SuccessfullyParsed = match.Groups.Count == 2; OK = (match.Groups[1].Value == MachNum) || !SuccessfullyParsed; } catch (System.ArgumentNullException) { throw; } catch (RegexMatchTimeoutException) { throw; } }
public IResourceMatch GetMatch(string resourcePath) { if (IsRegexMode) { return(new RegexResourceMatch(Rx.Match(resourcePath))); } else { return(new PathResourceMatch(Path, resourcePath)); } }