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; }
/// <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); }
/// <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); }
/// <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) { }
/// <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); }
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); }
/// <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); }
private protected virtual void InitCellViewTable() { _CellViewTable = CreateCellViewTable(); }
/// <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); }
/// <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);