Пример #1
0
        /// <inheritdoc/>
        public override bool IsEqual(CompareEqual comparer, IEqualComparable other)
        {
            Contract.RequireNotNull(other, out IEqualComparable Other);

            if (!comparer.IsSameType(Other, out LayoutInnerReadOnlyDictionary <TKey> AsOtherReadOnlyDictionary))
            {
                return(comparer.Failed());
            }

            if (!comparer.IsSameCount(Count, AsOtherReadOnlyDictionary.Count))
            {
                return(comparer.Failed());
            }

            foreach (TKey Key in Keys)
            {
                ILayoutInner Value = (ILayoutInner)this[Key];

                if (!comparer.IsTrue(AsOtherReadOnlyDictionary.ContainsKey(Key)))
                {
                    return(comparer.Failed());
                }

                if (!comparer.VerifyEqual(Value, AsOtherReadOnlyDictionary[Key]))
                {
                    return(comparer.Failed());
                }
            }

            return(true);
        }
Пример #2
0
        public ReplacementEntry(ILayoutInner inner, ILayoutInsertionChildNodeIndex insertionIndex)
        {
            Inner          = inner;
            InsertionIndex = insertionIndex;

            LayoutRootNodeIndex RootIndex = new LayoutRootNodeIndex(insertionIndex.Node);

            Controller = LayoutController.Create(RootIndex);
        }
Пример #3
0
 bool IDictionary <TKey, ILayoutInner> .TryGetValue(TKey key, out ILayoutInner value)
 {
     bool Result = TryGetValue(key, out IReadOnlyInner Value); value = (ILayoutInner)Value; return(Result);
 }
Пример #4
0
 void IDictionary <TKey, ILayoutInner> .Add(TKey key, ILayoutInner value)
 {
     throw new NotSupportedException("Collection is read-only.");
 }
 void IDictionary <TKey, ILayoutInner> .Add(TKey key, ILayoutInner value)
 {
     Add(key, value);
 }