private protected virtual string GetFocusedStringContent(IFocusStringContentFocus textCellFocus) { IFocusStringContentFocusableCellView CellView = textCellFocus.CellView; Node Node = CellView.StateView.State.Node; string PropertyName = CellView.PropertyName; return(NodeTreeHelper.GetString(Node, PropertyName)); }
private protected virtual void ExtendSelectionStringContent(IFocusStringContentSelection selection) { IFocusStringContentFocus AsStringContentFocus = Focus as IFocusStringContentFocus; Debug.Assert(AsStringContentFocus != null); string Text = GetFocusedStringContent(AsStringContentFocus); Debug.Assert(selection.Start <= selection.End); int SelectedCount = selection.End - selection.Start; Debug.Assert(SelectedCount == Text.Length); SelectNode(selection.StateView.State); }
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(FocusFocusList focusChain, Node focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { IFocusStringContentFocus NewFocus = CreateFocus(); focusChain.Add(NewFocus); if (focusedFrame == Frame) { IFocusOptionalNodeState AsOptionalNodeState = StateView.State as IFocusOptionalNodeState; Debug.Assert(AsOptionalNodeState == null || AsOptionalNodeState.ParentInner.IsAssigned); if (focusedNode == StateView.State.Node) { Debug.Assert(matchingFocus == null); matchingFocus = NewFocus; } } }