Beispiel #1
0
 public SubContext(string prefix, IPropertyValidator propertyValidator, PropertyRoute route, MappingContext parent) :
     base(prefix, propertyValidator, route)
 {
     this.parent = parent;
     this.root   = parent.Root;
     this.inputs = new ContextualSortedList <string>(parent.Inputs, prefix + TypeContext.Separator);
     this.errors = new ContextualDictionary <HashSet <string> >(root.GlobalErrors, prefix);
 }
Beispiel #2
0
        public ContextualSortedList(IDictionary <string, V> sortedList, string prefix)
        {
            ContextualSortedList <V> csl = sortedList as ContextualSortedList <V>;

            Debug.Assert(prefix.HasText());
            this.Prefix = prefix;

            Debug.Assert(csl == null || Prefix.StartsWith(csl.Prefix));

            this.global = csl == null ? (SortedList <string, V>)sortedList : csl.global;

            var parentStart = csl == null ? 0 : csl.startIndex;
            var parentEnd   = csl == null ? sortedList.Count : csl.endIndex;

            startIndex = this.BinarySearch(parentStart, parentEnd);

            endIndex = BinarySearchStartsWith(startIndex, parentEnd);
        }