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);
     }
 }
        /// <summary>
        /// Clears the cell view tree for this view.
        /// </summary>
        public virtual void ClearRootCellView()
        {
            if (RootCellView != null)
                RootCellView.ClearCellTree();

            RootCellView = null;
            _CellViewTable = null;
            CellViewTable = null;
        }
예제 #3
0
        /// <summary>
        /// Checks if the tree of cell views under this state is valid.
        /// </summary>
        public virtual bool IsCellViewTreeValid()
        {
            bool IsValid = true;

            IsValid &= RootCellView != null;

            if (IsValid && !(RootCellView is IFrameEmptyCellView))
            {
                FrameAssignableCellViewDictionary <string> ActualCellViewTable = CreateCellViewTable();
                IsValid &= RootCellView.IsCellViewTreeValid(CellViewTable, ActualCellViewTable);
                IsValid &= AllCellViewsProperlyAssigned(CellViewTable, ActualCellViewTable);
            }

            return(IsValid);
        }
예제 #4
0
        /// <summary>
        /// Checks if the tree of cell views under this state is valid.
        /// </summary>
        public virtual bool IsCellViewTreeValid()
        {
            bool IsValid = true;

            IsValid &= RootCellView != null;

            if (IsValid && !(RootCellView is IFrameEmptyCellView))
            {
                FrameAssignableCellViewDictionary <string> ActualCellViewTable = CreateCellViewTable();
                IsValid &= RootCellView.IsCellViewTreeValid(CellViewTable, ActualCellViewTable);

                Debug.Assert(ActualCellViewTable.Count == 0);
            }

            return(IsValid);
        }
예제 #5
0
        /// <summary>
        /// Checks if the tree of cell views under this state is valid.
        /// </summary>
        public virtual bool IsCellViewTreeValid()
        {
            bool IsValid = true;

            IsValid &= RootCellView != null;

            if (IsValid)
            {
                FrameAssignableCellViewDictionary <string>         EmptyCellViewTable    = CreateCellViewTable();
                FrameAssignableCellViewReadOnlyDictionary <string> ExpectedCellViewTable = EmptyCellViewTable.ToReadOnly();
                FrameAssignableCellViewDictionary <string>         ActualCellViewTable   = CreateCellViewTable();
                IsValid &= RootCellView.IsCellViewTreeValid(ExpectedCellViewTable, ActualCellViewTable);
                IsValid &= ActualCellViewTable.Count == 0;
            }

            return(IsValid);
        }
        private protected virtual bool AllCellViewsProperlyAssigned(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable)
        {
            bool IsAssigned = true;

            int ActualCount = 0;

            foreach (KeyValuePair <string, IFrameAssignableCellView> Entry in CellViewTable)
            {
                if (Entry.Value != null)
                {
                    ActualCount++;
                    IsAssigned &= actualCellViewTable.ContainsKey(Entry.Key);
                }
            }

            IsAssigned &= actualCellViewTable.Count == ActualCount;

            return(IsAssigned);
        }
 /// <inheritdoc/>
 public FrameAssignableCellViewReadOnlyDictionary(FrameAssignableCellViewDictionary <TKey> dictionary)
     : base(dictionary)
 {
 }
예제 #8
0
 /// <summary>
 /// Checks if the tree of cell views under this state is valid.
 /// </summary>
 /// <param name="expectedCellViewTable">Cell views that are associated to a property of the node.</param>
 /// <param name="actualCellViewTable">Cell views that are found in the tree.</param>
 public override bool IsCellViewTreeValid(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable)
 {
     return(true);
 }
예제 #9
0
        private protected virtual bool IsCellViewProperlyAssigned(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable)
        {
            bool IsAssigned = true;

            string PropertyName = null;

            foreach (KeyValuePair <string, IFrameAssignableCellView> Entry in expectedCellViewTable)
            {
                if (Entry.Value == this)
                {
                    PropertyName = Entry.Key;
                    break;
                }
            }

            IsAssigned &= IsAssignedToTable == (PropertyName != null);

            if (PropertyName != null)
            {
                foreach (KeyValuePair <string, IFrameAssignableCellView> Entry in actualCellViewTable)
                {
                    IsAssigned &= Entry.Value != this;
                }

                actualCellViewTable.Add(PropertyName, this);
            }

            return(IsAssigned);
        }
예제 #10
0
        /// <summary>
        /// Checks if the tree of cell views under this state is valid.
        /// </summary>
        /// <param name="expectedCellViewTable">Cell views that are associated to a property of the node.</param>
        /// <param name="actualCellViewTable">Cell views that are found in the tree.</param>
        public override bool IsCellViewTreeValid(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable)
        {
            bool IsValid = true;

            foreach (IFrameCellView CellView in CellViewList)
            {
                IsValid &= CellView.IsCellViewTreeValid(expectedCellViewTable, actualCellViewTable);
            }

            IsValid &= IsCellViewProperlyAssigned(expectedCellViewTable, actualCellViewTable);

            return(IsValid);
        }
예제 #11
0
 private protected virtual void InitCellViewTable()
 {
     _CellViewTable = CreateCellViewTable();
 }
예제 #12
0
        /// <summary>
        /// Checks if the tree of cell views under this state is valid.
        /// </summary>
        /// <param name="expectedCellViewTable">Cell views that are associated to a property of the node.</param>
        /// <param name="actualCellViewTable">Cell views that are found in the tree.</param>
        public override bool IsCellViewTreeValid(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable)
        {
            bool IsValid = true;

            IsValid &= ChildStateView.IsCellViewTreeValid();
            IsValid &= IsCellViewProperlyAssigned(expectedCellViewTable, actualCellViewTable);

            return(IsValid);
        }
예제 #13
0
 /// <summary>
 /// Checks if the tree of cell views under this state is valid.
 /// </summary>
 /// <param name="expectedCellViewTable">Cell views that are associated to a property of the node.</param>
 /// <param name="actualCellViewTable">Cell views that are found in the tree.</param>
 public abstract bool IsCellViewTreeValid(FrameAssignableCellViewReadOnlyDictionary <string> expectedCellViewTable, FrameAssignableCellViewDictionary <string> actualCellViewTable);