Example #1
0
        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;
            }
        }
Example #2
0
 public IResourceMatch GetMatch(string resourcePath)
 {
     if (IsRegexMode)
     {
         return(new RegexResourceMatch(Rx.Match(resourcePath)));
     }
     else
     {
         return(new PathResourceMatch(Path, resourcePath));
     }
 }