/* * Construction/destruction. */ public LinkedDictionary(int initCapacity, IEqualityComparer <TK> comparer, bool inAccessOrder, ILinkedDictionaryCtl <TK, TV> linkeddictctl) { _inAccessOrder = inAccessOrder; _orderedlist = new LinkedList <KeyValuePair <TK, TV> >(); _dict = new Dictionary <TK, LinkedListNode <KeyValuePair <TK, TV> > >(initCapacity, comparer); _linkeddictctl = linkeddictctl; }
protected LinkedDictionary(SerializationInfo srlzinfo, StreamingContext context) { if (null == srlzinfo) { throw new ArgumentNullException(); } IEqualityComparer <TK> comparer = srlzinfo.GetValue(cstrDictComparer, typeof(IEqualityComparer <TK>)) as IEqualityComparer <TK>; _inAccessOrder = srlzinfo.GetBoolean(cstrInAccessOrder); _orderedlist = srlzinfo.GetValue(cstrOrderedList, typeof(LinkedList <KeyValuePair <TK, TV> >)) as LinkedList <KeyValuePair <TK, TV> >; _dict = new Dictionary <TK, LinkedListNode <KeyValuePair <TK, TV> > >(_orderedlist.Count, comparer); _linkeddictctl = srlzinfo.GetValue(cstrLinkedDictCtl, typeof(ILinkedDictionaryCtl <TK, TV>)) as ILinkedDictionaryCtl <TK, TV>; }