| 314 | } |
| 315 | |
| 316 | private RelativeBy SimpleDirection(string direction, object locator) |
| 317 | { |
| 318 | if (string.IsNullOrEmpty(direction)) |
| 319 | { |
| 320 | throw new ArgumentNullException(nameof(direction), "Direction cannot be null or the empty string"); |
| 321 | } |
| 322 | |
| 323 | if (locator == null) |
| 324 | { |
| 325 | throw new ArgumentNullException(nameof(locator), "Element locator to cannot be null"); |
| 326 | } |
| 327 | |
| 328 | Dictionary<string, object> filter = new Dictionary<string, object>(); |
| 329 | filter["kind"] = direction; |
| 330 | filter["args"] = new List<object>() { GetSerializableObject(locator) }; |
| 331 | this.filters.Add(filter); |
| 332 | |
| 333 | return new RelativeBy(this.root, this.filters); |
| 334 | } |
| 335 | |
| 336 | private static object GetSerializableRoot(object root) |
| 337 | { |