/// <summary> /// Creates and initializes a new instance of a <see cref="ReadOnlyController"/> object. /// </summary> /// <param name="nodeIndex">Index of the root of the node tree.</param> public static ReadOnlyController Create(IReadOnlyRootNodeIndex nodeIndex) { ReadOnlyController Controller = new ReadOnlyController(); Controller.SetRoot(nodeIndex); Controller.SetInitialized(); return(Controller); }
private protected virtual void SetRoot(IReadOnlyRootNodeIndex rootIndex) { Debug.Assert(!IsInitialized); // Must be called during initialization IReadOnlyPlaceholderNodeState State = CreateRootNodeState(rootIndex); RootIndex = rootIndex; RootState = State; AddState(RootIndex, State); // Recursively build all states, starting from the root. BuildStateTable(null, null, rootIndex, State); }
/// <summary> /// Creates a IxxxPlaceholderNodeState object. /// </summary> private protected override IReadOnlyPlaceholderNodeState CreateRootNodeState(IReadOnlyRootNodeIndex nodeIndex) { ControllerTools.AssertNoOverride(this, Type.FromTypeof <LayoutController>()); return(new LayoutPlaceholderNodeState <ILayoutInner <ILayoutBrowsingChildIndex> >((ILayoutRootNodeIndex)nodeIndex)); }
/// <summary> /// Creates a IxxxPlaceholderNodeState object. /// </summary> private protected override IReadOnlyPlaceholderNodeState CreateRootNodeState(IReadOnlyRootNodeIndex nodeIndex) { ControllerTools.AssertNoOverride(this, typeof(FocusController)); return(new FocusPlaceholderNodeState <IFocusInner <IFocusBrowsingChildIndex> >((IFocusRootNodeIndex)nodeIndex)); }
/// <summary> /// Creates a IxxxPlaceholderNodeState object. /// </summary> private protected virtual IReadOnlyPlaceholderNodeState CreateRootNodeState(IReadOnlyRootNodeIndex nodeIndex) { ControllerTools.AssertNoOverride(this, Type.FromTypeof <ReadOnlyController>()); return(new ReadOnlyPlaceholderNodeState <IReadOnlyInner <IReadOnlyBrowsingChildIndex> >(nodeIndex)); }
/// <summary> /// Creates a IxxxPlaceholderNodeState object. /// </summary> private protected override IReadOnlyPlaceholderNodeState CreateRootNodeState(IReadOnlyRootNodeIndex nodeIndex) { ControllerTools.AssertNoOverride(this, Type.FromTypeof <WriteableController>()); return(new WriteablePlaceholderNodeState <IWriteableInner <IWriteableBrowsingChildIndex> >((IWriteableRootNodeIndex)nodeIndex)); }