/// <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); }
bool IDictionary <IFrameNodeState, IFrameNodeStateView> .TryGetValue(IFrameNodeState key, out IFrameNodeStateView value) { bool Result = TryGetValue((IFocusNodeState)key, out IFocusNodeStateView Value); value = Value; return(Result); }
/// <summary> /// Gets the frame that creates cells associated to a comment in a state. /// </summary> /// <param name="state">The state.</param> public virtual IFrameCommentFrame GetCommentFrame(IFrameNodeState state) { // Call overloads of this method if they exist. ControllerTools.AssertNoOverride(this, typeof(FrameTemplateSet)); Type OwnerType = state.Node.GetType(); Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType); IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType); IFrameCommentFrame Frame = Template.GetCommentFrame(); return(Frame); }
/// <summary> /// Create cells for the provided state view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> /// <param name="parentCellView">The parent cell view.</param> public override IFrameCellView BuildNodeCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IFrameNodeState State = context.StateView.State; int Value = NodeTreeHelper.GetEnumValue(State.Node, PropertyName); Debug.Assert(Value >= 0 && Value < Items.Count); IFrameKeywordFrame KeywordFrame = Items[Value]; IFrameDiscreteContentFocusableCellView CellView = CreateDiscreteContentFocusableCellView(context.StateView, parentCellView, KeywordFrame); ValidateDiscreteContentFocusableCellView(context, KeywordFrame, CellView); return(CellView); }
private protected override void Refresh(IFrameNodeState state) { Node FocusedNode = null; IFocusFrame FocusedFrame = null; if (Focus != null) { Focus.GetLocationInSourceCode(out FocusedNode, out FocusedFrame); } base.Refresh(state); UpdateFocusChain((IFocusNodeState)state, FocusedNode, FocusedFrame); }
/// <summary> /// Gets the frame that creates cells associated to a property in a state. /// </summary> /// <param name="state">The state.</param> /// <param name="propertyName">The property name.</param> public virtual IFrameFrame PropertyToFrame(IFrameNodeState state, string propertyName) { // Call overloads of this method if they exist. ControllerTools.AssertNoOverride(this, Type.FromTypeof <FrameTemplateSet>()); Type OwnerType = Type.FromGetType(state.Node); //Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType); //IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType); IFrameNodeTemplate Template = NodeTypeToTemplate(OwnerType); IFrameFrame Frame = Template.PropertyToFrame(propertyName); return(Frame); }
/// <summary> /// Create cells for the provided state view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> /// <param name="parentCellView">The parent cell view.</param> public virtual IFrameCellView BuildNodeCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IFrameNodeState State = context.StateView.State; Debug.Assert(State != null); Debug.Assert(State.InnerTable != null); Debug.Assert(State.InnerTable.ContainsKey(PropertyName)); IFrameListInner <IFrameBrowsingListNodeIndex> Inner = State.InnerTable[PropertyName] as IFrameListInner <IFrameBrowsingListNodeIndex>; Debug.Assert(Inner != null); FrameNodeStateViewDictionary StateViewTable = context.ControllerView.StateViewTable; FrameCellViewList CellViewList = CreateCellViewList(); IFrameCellViewCollection EmbeddingCellView = CreateEmbeddingCellView(context.StateView, parentCellView, CellViewList); ValidateEmbeddingCellView(context, EmbeddingCellView); foreach (IFrameNodeState ChildState in Inner.StateList) { Debug.Assert(StateViewTable.ContainsKey(ChildState)); IFrameNodeStateView StateView = context.StateView; IFrameNodeStateView ChildStateView = (IFrameNodeStateView)StateViewTable[ChildState]; Debug.Assert(ChildStateView.RootCellView == null); context.SetChildStateView(ChildStateView); ChildStateView.BuildRootCellView(context); context.RestoreParentStateView(StateView); Debug.Assert(ChildStateView.RootCellView != null); IFrameContainerCellView FrameCellView = CreateFrameCellView(context.StateView, EmbeddingCellView, ChildStateView); ValidateContainerCellView(context.StateView, EmbeddingCellView, ChildStateView, FrameCellView); ChildStateView.SetContainerCellView(FrameCellView); CellViewList.Add(FrameCellView); } AssignEmbeddingCellView(context.StateView, EmbeddingCellView); return(EmbeddingCellView); }
/// <summary> /// Create cells for the provided state view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> /// <param name="parentCellView">The parent cell view.</param> public virtual IFrameCellView BuildNodeCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IFrameNodeState State = context.StateView.State; Debug.Assert(State != null); Debug.Assert(State.InnerTable != null); Debug.Assert(State.InnerTable.ContainsKey(PropertyName)); IFrameBlockListInner <IFrameBrowsingBlockNodeIndex> Inner = State.InnerTable[PropertyName] as IFrameBlockListInner <IFrameBrowsingBlockNodeIndex>; Debug.Assert(Inner != null); FrameBlockStateViewDictionary BlockStateViewTable = context.ControllerView.BlockStateViewTable; FrameCellViewList CellViewList = CreateCellViewList(); IFrameCellViewCollection EmbeddingCellView = CreateEmbeddingCellView(context.StateView, parentCellView, CellViewList); ValidateEmbeddingCellView(context, EmbeddingCellView); Type BlockType = Inner.BlockType; IFrameTemplateSet TemplateSet = context.ControllerView.TemplateSet; IFrameBlockTemplate BlockTemplate = TemplateSet.BlockTypeToTemplate(BlockType); foreach (IFrameBlockState BlockState in Inner.BlockStateList) { Debug.Assert(context.ControllerView.BlockStateViewTable.ContainsKey(BlockState)); FrameBlockStateView BlockStateView = (FrameBlockStateView)context.ControllerView.BlockStateViewTable[BlockState]; context.SetBlockStateView(BlockStateView); BlockStateView.BuildRootCellView(context); IFrameBlockCellView BlockCellView = CreateBlockCellView(context.StateView, EmbeddingCellView, BlockStateView); ValidateBlockCellView(context.StateView, EmbeddingCellView, BlockStateView, BlockCellView); CellViewList.Add(BlockCellView); } AssignEmbeddingCellView(context.StateView, EmbeddingCellView); return(EmbeddingCellView); }
/// <summary> /// Create cells for the provided state view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> /// <param name="parentCellView">The parent cell view.</param> public virtual IFrameCellView BuildNodeCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IFrameNodeState State = context.StateView.State; Debug.Assert(State != null); Debug.Assert(State.InnerTable != null); Debug.Assert(State.InnerTable.ContainsKey(PropertyName)); IFramePlaceholderInner <IFrameBrowsingPlaceholderNodeIndex> Inner = State.InnerTable[PropertyName] as IFramePlaceholderInner <IFrameBrowsingPlaceholderNodeIndex>; Debug.Assert(Inner != null); Debug.Assert(Inner.ChildState != null); IFrameNodeState ChildState = Inner.ChildState; IFrameStateViewDictionary StateViewTable = context.ControllerView.StateViewTable; Debug.Assert(StateViewTable.ContainsKey(ChildState)); IFrameNodeStateView StateView = context.StateView; IFrameNodeStateView ChildStateView = StateViewTable[ChildState]; Debug.Assert(ChildStateView.RootCellView == null); context.SetChildStateView(ChildStateView); ChildStateView.BuildRootCellView(context); context.RestoreParentStateView(StateView); Debug.Assert(ChildStateView.RootCellView != null); IFrameContainerCellView EmbeddingCellView = CreateFrameCellView(context.StateView, parentCellView, ChildStateView); ValidateContainerCellView(context.StateView, parentCellView, ChildStateView, EmbeddingCellView); ChildStateView.SetContainerCellView(EmbeddingCellView); AssignEmbeddingCellView(context.StateView, EmbeddingCellView); return(EmbeddingCellView); }
/// <summary> /// Initializes a new instance of the <see cref="FrameCollectionInner{IIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> /// <param name="propertyName">Property name of the inner in <paramref name="owner"/>.</param> public FrameCollectionInner(IFrameNodeState owner, string propertyName) : base(owner, propertyName) { }
/// <summary> /// Initializes a new instance of the <see cref="FramePlaceholderInner{IIndex, TIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> /// <param name="propertyName">Property name of the inner in <paramref name="owner"/>.</param> public FramePlaceholderInner(IFrameNodeState owner, string propertyName) : base(owner, propertyName) { }
private protected virtual IFrameCellView BuildPlaceholderCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView, IFrameNodeState childState, IFramePlaceholderFrame frame) { FrameNodeStateViewDictionary StateViewTable = context.ControllerView.StateViewTable; Debug.Assert(StateViewTable.ContainsKey(childState)); IFrameNodeStateView StateView = context.StateView; IFrameNodeStateView ChildStateView = (IFrameNodeStateView)StateViewTable[childState]; Debug.Assert(ChildStateView.RootCellView == null); context.SetChildStateView(ChildStateView); ChildStateView.BuildRootCellView(context); context.RestoreParentStateView(StateView); Debug.Assert(ChildStateView.RootCellView != null); IFrameContainerCellView Result = CreateFrameCellView(context.StateView, parentCellView, ChildStateView, frame); ChildStateView.SetContainerCellView(Result); return(Result); }
IFrameNodeStateView IDictionary <IFrameNodeState, IFrameNodeStateView> .this[IFrameNodeState key] { get { return(this[(IFocusNodeState)key]); } set { this[(IFocusNodeState)key] = (IFocusNodeStateView)value; } }
private protected override void Refresh(IFrameNodeState state) { base.Refresh(state); IsInvalidated = true; }
bool IReadOnlyDictionary <IFrameIndex, IFrameNodeState> .TryGetValue(IFrameIndex key, out IFrameNodeState value) { bool Result = TryGetValue((IFocusIndex)key, out IFocusNodeState Value); value = Value; return(Result); }
/// <summary> /// Initializes a new instance of the <see cref="FrameNodeStateView"/> class. /// </summary> /// <param name="controllerView">The controller view to which this object belongs.</param> /// <param name="state">The node state.</param> public FrameNodeStateView(FrameControllerView controllerView, IFrameNodeState state) : base(controllerView, state) { }
bool IDictionary <IFrameNodeState, IFrameNodeStateView> .ContainsKey(IFrameNodeState key) { return(ContainsKey((IFocusNodeState)key)); }
/// <summary> /// Initializes a new instance of the <see cref="FrameInner{IIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> protected FrameInner(IFrameNodeState owner) : base(owner) { }
void IDictionary <IFrameIndex, IFrameNodeState> .Add(IFrameIndex key, IFrameNodeState value) { Add((ILayoutIndex)key, (ILayoutNodeState)value); }
void IDictionary <IFrameIndex, IFrameNodeState> .Add(IFrameIndex key, IFrameNodeState value) { Add((IFocusIndex)key, (IFocusNodeState)value); }
bool ICollection <IFrameNodeState> .Contains(IFrameNodeState value) { return(Contains((IFocusNodeState)value)); }
bool IDictionary <IFrameNodeState, IFrameNodeStateView> .Remove(IFrameNodeState key) { return(Remove((IFocusNodeState)key)); }
/// <summary> /// Initializes a new instance of the <see cref="FrameBlockListInner{IIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> protected FrameBlockListInner(IFrameNodeState owner) : base(owner) { }
bool ICollection <IFrameNodeState> .Remove(IFrameNodeState item) { return(Remove((IFocusNodeState)item)); }
void ICollection <IFrameNodeState> .Add(IFrameNodeState item) { Add((IFocusNodeState)item); }
void IDictionary <IFrameNodeState, IFrameNodeStateView> .Add(IFrameNodeState key, IFrameNodeStateView value) { Add((IFocusNodeState)key, (IFocusNodeStateView)value); }
bool IDictionary <IFrameIndex, IFrameNodeState> .TryGetValue(IFrameIndex key, out IFrameNodeState value) { bool Result = TryGetValue((ILayoutIndex)key, out ILayoutNodeState Value); value = Value; return(Result); }
/// <summary> /// Initializes a new instance of the <see cref="FrameListInner{IIndex, TIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> /// <param name="propertyName">Property name of the inner in <paramref name="owner"/>.</param> public FrameListInner(IFrameNodeState owner, string propertyName) : base(owner, propertyName) { }
/// <summary> /// Initializes a new instance of the <see cref="FrameBrowseContext"/> class. /// </summary> /// <param name="state">The state that will be browsed.</param> public FrameBrowseContext(IFrameNodeState state) : base(state) { }
/// <summary> /// Initializes a new instance of the <see cref="FrameOptionalInner{IIndex}"/> class. /// </summary> /// <param name="owner">Parent containing the inner.</param> /// <param name="propertyName">Property name of the inner in <paramref name="owner"/>.</param> public FrameOptionalInner(IFrameNodeState owner, string propertyName) : base(owner, propertyName) { }