Esempio n. 1
0
        /// <inheritdoc/>
        public override bool IsEqual(CompareEqual comparer, IEqualComparable other)
        {
            Contract.RequireNotNull(other, out IEqualComparable Other);

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

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

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

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

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

            return(true);
        }
        bool IReadOnlyDictionary <TKey, IFrameInner> .TryGetValue(TKey key, out IFrameInner value)
        {
            bool Result = TryGetValue(key, out IFocusInner Value);

            value = Value;
            return(Result);
        }
        bool IDictionary <TKey, IFrameInner> .TryGetValue(TKey key, out IFrameInner value)
        {
            bool Result = TryGetValue(key, out ILayoutInner Value);

            value = Value;
            return(Result);
        }
        /// <summary>
        /// Gets the frame that creates cells associated to states in the inner.
        /// </summary>
        /// <param name="inner">The inner.</param>
        public virtual IFrameFrame InnerToFrame(IFrameInner <IFrameBrowsingChildIndex> inner)
        {
            // Call overloads of this method if they exist.
            ControllerTools.AssertNoOverride(this, Type.FromTypeof <FrameTemplateSet>());

            IFrameNodeState Owner     = inner.Owner;
            Type            OwnerType = Type.FromGetType(Owner.Node);

            //Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            //IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType);
            IFrameNodeTemplate Template = NodeTypeToTemplate(OwnerType);

            IFrameFrame Frame = Template.PropertyToFrame(inner.PropertyName);

            if (Frame is IFrameBlockListFrame AsBlockListFrame)
            {
                IFrameBlockListInner <IFrameBrowsingBlockNodeIndex> BlockListInner = inner as IFrameBlockListInner <IFrameBrowsingBlockNodeIndex>;
                Debug.Assert(BlockListInner != null);

                Type BlockType = NodeTreeHelperBlockList.BlockListBlockType(Owner.Node, BlockListInner.PropertyName);
                IFrameBlockTemplate BlockTemplate = BlockTypeToTemplate(BlockType);

                Frame = BlockTemplate.GetPlaceholderFrame();
            }

            return(Frame);
        }
 private protected virtual void InitCellViewTable()
 {
     _CellViewTable = CreateCellViewTable();
     foreach (string Key in State.InnerTable.Keys)
     {
         IFrameInner Value = (IFrameInner)State.InnerTable[Key];
         _CellViewTable.Add(Value.PropertyName, null);
     }
 }
        private protected override IFrameFrame GetAssociatedFrame(IFrameInner <IFrameBrowsingChildIndex> inner)
        {
            IFocusNodeState                Owner         = ((IFocusInner <IFocusBrowsingChildIndex>)inner).Owner;
            IFocusNodeStateView            StateView     = (IFocusNodeStateView)StateViewTable[Owner];
            IList <FocusFrameSelectorList> SelectorStack = StateView.GetSelectorStack();

            IFocusFrame AssociatedFrame = TemplateSet.InnerToFrame((IFocusInner <IFocusBrowsingChildIndex>)inner, SelectorStack) as IFocusFrame;

            return(AssociatedFrame);
        }
Esempio n. 7
0
 void IDictionary <TKey, IFrameInner> .Add(TKey key, IFrameInner value)
 {
     throw new NotSupportedException("Collection is read-only.");
 }
 void IDictionary <TKey, IFrameInner> .Add(TKey key, IFrameInner value)
 {
     Add(key, (ILayoutInner)value);
 }
Esempio n. 9
0
 void IDictionary <TKey, IFrameInner> .Add(TKey key, IFrameInner value)
 {
     Add(key, (IFocusInner)value);
 }
 void IDictionary <TKey, IFrameInner> .Add(TKey key, IFrameInner value)
 {
     Add(key, value);
 }