/// <summary> /// Compares two <see cref="IFocusInnerReadOnlyDictionary{TKey}"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out FocusInnerReadOnlyDictionary <TKey> AsInnerReadOnlyDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsInnerReadOnlyDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <TKey, IFocusInner> Entry in this) { if (!comparer.IsTrue(AsInnerReadOnlyDictionary.ContainsKey(Entry.Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Entry.Value, AsInnerReadOnlyDictionary[Entry.Key])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="IReadOnlyInner"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out ReadOnlyBlockListInner <IIndex, TIndex> AsBlockListInner)) { return(comparer.Failed()); } if (!base.IsEqual(comparer, AsBlockListInner)) { return(comparer.Failed()); } if (!comparer.IsSameCount(BlockStateList.Count, AsBlockListInner.BlockStateList.Count)) { return(comparer.Failed()); } for (int i = 0; i < BlockStateList.Count; i++) { if (!comparer.VerifyEqual(BlockStateList[i], AsBlockListInner.BlockStateList[i])) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out WriteableInnerDictionary <TKey> AsOtherDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherDictionary.Count)) { return(comparer.Failed()); } foreach (TKey Key in Keys) { IWriteableInner Value = (IWriteableInner)this[Key]; if (!comparer.IsTrue(AsOtherDictionary.ContainsKey(Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Value, AsOtherDictionary[Key])) { return(comparer.Failed()); } } return(true); }
private protected virtual bool IsChildrenEqual(CompareEqual comparer, IReadOnlyNodeState nodeState) { if (!comparer.VerifyEqual(InnerTable, nodeState.InnerTable)) { return(comparer.Failed()); } if (!comparer.IsSameCount(ValuePropertyTypeTable.Count, nodeState.ValuePropertyTypeTable.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <string, ValuePropertyType> Entry in ValuePropertyTypeTable) { if (!comparer.IsTrue(nodeState.ValuePropertyTypeTable.ContainsKey(Entry.Key))) { return(comparer.Failed()); } if (!comparer.IsTrue(nodeState.ValuePropertyTypeTable[Entry.Key] == Entry.Value)) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { if (!comparer.IsSameType(other, out ReadOnlyListInner <TIndex> AsListInner)) { return(comparer.Failed()); } if (!base.IsEqual(comparer, AsListInner)) { return(comparer.Failed()); } if (!comparer.IsSameCount(StateList.Count, AsListInner.StateList.Count)) { return(comparer.Failed()); } for (int i = 0; i < StateList.Count; i++) { if (!comparer.VerifyEqual(StateList[i], AsListInner.StateList[i])) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out LayoutBlockStateViewReadOnlyDictionary AsOtherReadOnlyDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherReadOnlyDictionary.Count)) { return(comparer.Failed()); } foreach (ILayoutBlockState Key in Keys) { LayoutBlockStateView Value = (LayoutBlockStateView)this[Key]; if (!comparer.IsTrue(AsOtherReadOnlyDictionary.ContainsKey(Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Value, AsOtherReadOnlyDictionary[Key])) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out FrameAssignableCellViewDictionary <TKey> AsOtherDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <TKey, IFrameAssignableCellView> Entry in this) { if (!comparer.IsTrue(AsOtherDictionary.ContainsKey(Entry.Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Entry.Value, AsOtherDictionary[Entry.Key])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="IReadOnlyBlockStateViewDictionary"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out ReadOnlyBlockStateViewDictionary AsBlockStateViewDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsBlockStateViewDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <IReadOnlyBlockState, IReadOnlyBlockStateView> Entry in this) { if (!comparer.IsTrue(AsBlockStateViewDictionary.ContainsKey(Entry.Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Entry.Value, AsBlockStateViewDictionary[Entry.Key])) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out ReadOnlyNodeStateViewReadOnlyDictionary AsOtherReadOnlyDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherReadOnlyDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <IReadOnlyNodeState, IReadOnlyNodeStateView> Entry in this) { if (!comparer.IsTrue(AsOtherReadOnlyDictionary.ContainsKey(Entry.Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Entry.Value, AsOtherReadOnlyDictionary[Entry.Key])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="IFocusStateViewDictionary"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out FocusStateViewDictionary AsStateViewDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsStateViewDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <IFocusNodeState, IFocusNodeStateView> Entry in this) { IFocusNodeState Key = Entry.Key; IFocusNodeStateView Value = Entry.Value; if (!comparer.IsTrue(AsStateViewDictionary.ContainsKey(Key))) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Value, AsStateViewDictionary[Key])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="ILayoutAssignableCellViewReadOnlyDictionary{TKey}"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out LayoutAssignableCellViewReadOnlyDictionary <TKey> AsAssignableCellViewReadOnlyDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsAssignableCellViewReadOnlyDictionary.Count)) { return(comparer.Failed()); } foreach (KeyValuePair <TKey, ILayoutAssignableCellView> Entry in this) { Debug.Assert(Entry.Key != null); if (!comparer.IsTrue(AsAssignableCellViewReadOnlyDictionary.ContainsKey(Entry.Key))) { return(comparer.Failed()); } ILayoutAssignableCellView OtherValue = AsAssignableCellViewReadOnlyDictionary[Entry.Key] as ILayoutAssignableCellView; if (!comparer.IsTrue((Entry.Value != null && OtherValue != null) || (Entry.Value == null && OtherValue == null))) { return(comparer.Failed()); } if (Entry.Value != null) { if (!comparer.VerifyEqual(Entry.Value, OtherValue)) { return(comparer.Failed()); } } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out LayoutAssignableCellViewReadOnlyDictionary <TKey> AsOtherReadOnlyDictionary)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherReadOnlyDictionary.Count)) { return(comparer.Failed()); } foreach (TKey Key in Keys) { if (!comparer.IsTrue(AsOtherReadOnlyDictionary.ContainsKey(Key))) { return(comparer.Failed()); } ILayoutAssignableCellView ThisValue = (ILayoutAssignableCellView)this[Key]; ILayoutAssignableCellView OtherValue = (ILayoutAssignableCellView)AsOtherReadOnlyDictionary[Key]; if (!comparer.IsTrue((ThisValue is null && OtherValue is null) || (ThisValue is not null && OtherValue is not null))) { return(comparer.Failed()); } if (ThisValue is not null) { if (!comparer.VerifyEqual(ThisValue, OtherValue)) { return(comparer.Failed()); } } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out FocusAssignableCellViewDictionary<TKey> AsOtherDictionary)) return comparer.Failed(); if (!comparer.IsSameCount(Count, AsOtherDictionary.Count)) return comparer.Failed(); foreach (TKey Key in Keys) { IFocusAssignableCellView Value = (IFocusAssignableCellView)this[Key]; if (!comparer.IsTrue(AsOtherDictionary.ContainsKey(Key))) return comparer.Failed(); if (!comparer.VerifyEqual(Value, AsOtherDictionary[Key])) return comparer.Failed(); } return true; }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out LayoutFrameSelectorReadOnlyList AsOtherReadOnlyList)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherReadOnlyList.Count)) { return(comparer.Failed()); } for (int i = 0; i < Count; i++) { if (!comparer.VerifyEqual(this[i], AsOtherReadOnlyList[i])) { return(comparer.Failed()); } } return(true); }
/// <inheritdoc/> public override bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out FocusPlaceholderNodeStateList AsOtherList)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherList.Count)) { return(comparer.Failed()); } for (int i = 0; i < Count; i++) { if (!comparer.VerifyEqual(this[i], AsOtherList[i])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="IFrameCellViewList"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out FrameCellViewList AsCellViewList)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsCellViewList.Count)) { return(comparer.Failed()); } for (int i = 0; i < Count; i++) { if (!comparer.VerifyEqual(this[i], AsCellViewList[i])) { return(comparer.Failed()); } } return(true); }
private bool IsEqualFields(CompareEqual comparer, ReadOnlyController other) { if (!comparer.VerifyEqual(RootIndex, other.RootIndex)) { return(comparer.Failed()); } if (!comparer.VerifyEqual(RootState, other.RootState)) { return(comparer.Failed()); } if (!comparer.VerifyEqual(Stats, other.Stats)) { return(comparer.Failed()); } if (!comparer.IsSameCount(StateTable.Count, other.StateTable.Count)) { return(comparer.Failed()); } return(true); }
/// <inheritdoc/> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Contract.RequireNotNull(other, out IEqualComparable Other); if (!comparer.IsSameType(Other, out FrameCellViewList AsOtherList)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsOtherList.Count)) { return(comparer.Failed()); } for (int i = 0; i < Count; i++) { if (!comparer.VerifyEqual(this[i], AsOtherList[i])) { return(comparer.Failed()); } } return(true); }
/// <summary> /// Compares two <see cref="IWriteablePlaceholderNodeStateReadOnlyList"/> objects. /// </summary> /// <param name="comparer">The comparison support object.</param> /// <param name="other">The other object.</param> public virtual bool IsEqual(CompareEqual comparer, IEqualComparable other) { Debug.Assert(other != null); if (!comparer.IsSameType(other, out WriteablePlaceholderNodeStateReadOnlyList AsPlaceholderNodeStateReadOnlyList)) { return(comparer.Failed()); } if (!comparer.IsSameCount(Count, AsPlaceholderNodeStateReadOnlyList.Count)) { return(comparer.Failed()); } for (int i = 0; i < Count; i++) { if (!comparer.VerifyEqual(this[i], AsPlaceholderNodeStateReadOnlyList[i])) { return(comparer.Failed()); } } return(true); }