Beispiel #1
0
        public virtual void CheckConsistency()
        {
            IReadOnlyIndexCollectionList         InternalList = InternalIndexCollectionList;
            IReadOnlyIndexCollectionReadOnlyList PublicList   = IndexCollectionList;

            for (int i = 0; i < InternalList.Count; i++)
            {
                IReadOnlyIndexCollection InternalItem = InternalList[i];
                Debug.Assert(PublicList.Contains(InternalItem));
                Debug.Assert(PublicList.IndexOf(InternalItem) >= 0);

                IReadOnlyIndexCollection PublicItem = PublicList[i];
                Debug.Assert(InternalList.Contains(PublicItem));
                Debug.Assert(InternalList.IndexOf(PublicItem) >= 0);

                if (i == 0)
                {
                    Debug.Assert(!((ICollection <IReadOnlyIndexCollection>)InternalList).IsReadOnly);

                    InternalList.Remove(InternalItem);
                    InternalList.Insert(0, InternalItem);

                    IEnumerable <IReadOnlyIndexCollection> AsEnumerable = InternalList;
                    foreach (IReadOnlyIndexCollection Item in AsEnumerable)
                    {
                        Debug.Assert(Item == InternalItem);
                        break;
                    }
                }
            }
        }
 public ReadOnlyIndexCollectionReadOnlyList(IReadOnlyIndexCollectionList list)
     : base(list)
 {
 }