/// <summary>
        /// Checks the context consistency, for code coverage purpose.
        /// </summary>
        public override void CheckConsistency()
        {
            base.CheckConsistency();

            Debug.Assert(State != null);

            IWriteableIndexCollectionList         InternalList = InternalIndexCollectionList as IWriteableIndexCollectionList;
            IWriteableIndexCollectionReadOnlyList PublicList   = IndexCollectionList;

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

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

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

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

                    if (InternalList.GetType() == typeof(WriteableIndexCollectionList))
                    {
                        InternalList.CopyTo((IReadOnlyIndexCollection[])(new IWriteableIndexCollection[InternalList.Count]), 0);
                    }

                    IEnumerable <IWriteableIndexCollection> AsEnumerable = InternalList;
                    foreach (IWriteableIndexCollection Item in AsEnumerable)
                    {
                        Debug.Assert(Item == InternalItem);
                        break;
                    }

                    IList <IReadOnlyIndexCollection> AsIList = InternalList;
                    Debug.Assert(AsIList[0] == InternalItem);

                    IReadOnlyList <IReadOnlyIndexCollection> AsIReadOnlyList = InternalList;
                    Debug.Assert(AsIReadOnlyList[0] == InternalItem);
                }
            }
        }
 void IList <IWriteableIndexCollection> .Insert(int index, IWriteableIndexCollection item)
 {
     Insert(index, (IFrameIndexCollection)item);
 }
 bool ICollection <IWriteableIndexCollection> .Remove(IWriteableIndexCollection item)
 {
     return(Remove((IFrameIndexCollection)item));
 }
 int IList <IWriteableIndexCollection> .IndexOf(IWriteableIndexCollection value)
 {
     return(IndexOf((IFrameIndexCollection)value));
 }
 bool ICollection <IWriteableIndexCollection> .Contains(IWriteableIndexCollection value)
 {
     return(Contains((IFrameIndexCollection)value));
 }
 void ICollection <IWriteableIndexCollection> .Add(IWriteableIndexCollection item)
 {
     Add((IFrameIndexCollection)item);
 }
Esempio n. 7
0
 int IWriteableIndexCollectionReadOnlyList.IndexOf(IWriteableIndexCollection value)
 {
     return(IndexOf((IFocusIndexCollection)value));
 }
Esempio n. 8
0
 bool IWriteableIndexCollectionReadOnlyList.Contains(IWriteableIndexCollection value)
 {
     return(Contains((IFocusIndexCollection)value));
 }
 void ICollection <IWriteableIndexCollection> .Add(IWriteableIndexCollection item)
 {
     Add((ILayoutIndexCollection)item);
 }