Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="range"></param>
 internal OrderedListDictionaryView(
     OrderedListDictionary <TK, TV> parent,
     BoundRange <TK> range)
 {
     _parent = parent;
     _range  = range;
     _keys   = new OrderedListDictionaryKeys <TK, TV>(_parent, _range);
     _values = new OrderedListDictionaryValues <TK, TV>(_parent, _range);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderedListDictionary{TK,TV}"/> class.
        /// </summary>
        /// <param name="keyComparer">The key comparer.</param>
        public OrderedListDictionary(IComparer <TK> keyComparer)
        {
            _itemList     = new List <KeyValuePair <TK, TV> >();
            _itemComparer = new KeyValuePairComparer(keyComparer, false);

            var range = new BoundRange <TK>(null, null, keyComparer);

            _keys   = new OrderedListDictionaryKeys <TK, TV>(this, range);
            _values = new OrderedListDictionaryValues <TK, TV>(this, range);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderedListDictionary{TK,TV}" /> class.
        /// </summary>
        /// <param name="itemList">The item list.</param>
        /// <param name="comparer">The comparer.</param>
        internal OrderedListDictionary(
            List <KeyValuePair <TK, TV> > itemList,
            KeyValuePairComparer comparer)
        {
            _itemList     = itemList;
            _itemComparer = comparer;

            var range = new BoundRange <TK>(null, null, comparer.KeyComparer);

            _keys   = new OrderedListDictionaryKeys <TK, TV>(this, range);
            _values = new OrderedListDictionaryValues <TK, TV>(this, range);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderedListDictionary{TK,TV}"/> class.
        /// </summary>
        public OrderedListDictionary()
        {
            var comparer = Comparers.Default <TK>();

            //var comparer = Comparer<TK>.Default;
            _itemList     = new List <KeyValuePair <TK, TV> >();
            _itemComparer = new KeyValuePairComparer(comparer, false);

            var range = new BoundRange <TK>(null, null, comparer);

            _keys   = new OrderedListDictionaryKeys <TK, TV>(this, range);
            _values = new OrderedListDictionaryValues <TK, TV>(this, range);
        }