public bool IsBetween(LocationChain start, LocationChain end) { bool first = this.First().IsBetween(start.First(), end.First()); bool last = this.Last().IsBetween(start.Last(), end.Last()); return(first || last); }
/// <summary> /// Populates the locations. /// </summary> /// <param name="filePath">The file path.</param> private static void PopulateLocations(string filePath) { Locations = new Dictionary <int, LocationChain>(); using (StreamReader sr = new StreamReader(filePath)) { string[] locations = sr.ReadLine().Split(new char[] { '\x1D' }); for (int i = 0; i < locations.Length; i++) { string line = locations[i]; string[] chain = line.Split(new char[] { '\x1E' }); LocationChain locationChain = new LocationChain(); foreach (string c in chain) { if (c != string.Empty) { string[] source = c.Split(new char[] { '\x1F' }); locationChain.Add(new Location { SourceLocation = i, Line = Convert.ToInt32(source[0]), Column = Convert.ToInt32(source[1]), File = source[2], Directory = new DirectoryInfo(source[3]).FullName, }); } } if (locationChain.Any()) { Locations.Add(i, locationChain); } } } }