protected override void OnDeserialization(object sender)
 {
     if (_sinfo != null)
     {
         _comparer = (IComparer <T>)_sinfo.GetValue(SerializationString.Comparer, typeof(IComparer <T>));
         _max      = (T)_sinfo.GetValue(SerializationString.Max, typeof(T));
         _min      = (T)_sinfo.GetValue(SerializationString.Min, typeof(T));
         int count = _sinfo.GetInt32(SerializationString.Count);
         if (count != 0)
         {
             T[] data = (T[])_sinfo.GetValue(SerializationString.Data, typeof(T[]));
             if (data == null)
             {
                 Thrower.SerializationException(Resources.Serialization_ValuesMissing);
             }
             _underlying = new SortedLinkedList <T>(data);
         }
         else
         {
             _underlying = new SortedLinkedList <T>();
         }
         if (count != _underlying._count)
         {
             Thrower.SerializationException(Resources.Serialization_CountNotMatch);
         }
         _underlying._version = _sinfo.GetInt32(SerializationString.Version);
         _count = _underlying._count;
         UpdateSubList();
         _sinfo = null;
     }
 }
 public SubListView(SortedLinkedList <T> list, T min, T max)
 {
     this._underlying = list;
     this._version    = list._version - 1;
     this._min        = min;
     this._max        = max;
     this.InternalCheckVersion();
 }
예제 #3
0
 internal Enumerator(SortedLinkedList <T> list)
 {
     _list    = list;
     _version = list._version;
     _index   = 0;
     _current = default(T);
     _node    = list.StartNode();
     steps    = -1;
 }
 private Enumerator(SerializationInfo info, StreamingContext context)
 {
     _list    = null;
     _version = 0;
     _index   = 0;
     _current = default(T);
     _node    = null;
     steps    = -1;
     _info    = info;
 }
 void IDeserializationCallback.OnDeserialization(object sender)
 {
     if (_list == null)
     {
         if (_info == null)
         {
             Thrower.SerializationException(Resources.Serialization_InvalidOnDeserialization);
         }
         _list    = (SortedLinkedList <T>)_info.GetValue(SerializationString.Collection, typeof(SortedLinkedList <T>));
         _version = _info.GetInt32(SerializationString.Version);
         _index   = _info.GetInt32(SerializationString.Index);
         _current = (T)_info.GetValue(SerializationString.Current, typeof(T));
         if (_list._sinfo != null)
         {
             _list.OnDeserialization(sender);
         }
         SetNode();
     }
     _info = null;
 }