/// <summary> /// Creates and initializes a new instance of a <see cref="LayoutControllerView"/> object. /// </summary> /// <param name="controller">The controller on which the view is attached.</param> /// <param name="templateSet">The template set used to describe the view.</param> /// <param name="context">The context used to measure, arrange, and draw or print the view.</param> public static LayoutControllerView Create(LayoutController controller, ILayoutTemplateSet templateSet, ILayoutMeasureContext context) { LayoutControllerView View = new LayoutControllerView(controller, templateSet, context); View.Init(); return(View); }
/// <summary> /// Initializes a new instance of the <see cref="LayoutControllerView"/> class. /// </summary> /// <param name="controller">The controller on which the view is attached.</param> /// <param name="templateSet">The template set used to describe the view.</param> /// <param name="context">The context used to measure, arrange, and draw or print the view.</param> private protected LayoutControllerView(LayoutController controller, ILayoutTemplateSet templateSet, ILayoutMeasureContext context) : base(controller, templateSet) { MeasureContext = context; DrawContext = context as ILayoutDrawContext; PrintContext = context as ILayoutPrintContext; InternalViewSize = RegionHelper.InvalidSize; IsInvalidated = true; ShowUnfocusedComments = true; }
/// <summary> /// Prints the selection. /// </summary> public virtual void Print() { ILayoutControllerView ControllerView = StateView.ControllerView; Debug.Assert(ControllerView.PrintContext != null); ControllerView.UpdateLayout(); Debug.Assert(RegionHelper.IsValid(StateView.ActualCellSize)); ILayoutTemplateSet TemplateSet = ControllerView.TemplateSet; IList <IFocusFrameSelectorList> SelectorStack = StateView.GetSelectorStack(); ILayoutDiscreteFrame Frame = (ILayoutDiscreteFrame)TemplateSet.PropertyToFrame(StateView.State, PropertyName, SelectorStack); Debug.Assert(Frame != null); int Value = NodeTreeHelper.GetEnumValue(StateView.State.Node, PropertyName); Frame.Print(ControllerView.PrintContext, Value, Point.Origin); }
/// <summary> /// Prints the selection. /// </summary> public virtual void Print() { LayoutControllerView ControllerView = StateView.ControllerView; Debug.Assert(ControllerView.PrintContext != null); ControllerView.UpdateLayout(); Debug.Assert(RegionHelper.IsValid(StateView.ActualCellSize)); ILayoutTemplateSet TemplateSet = ControllerView.TemplateSet; IList <FocusFrameSelectorList> SelectorStack = StateView.GetSelectorStack(); ILayoutTextValueFrame Frame = (ILayoutTextValueFrame)TemplateSet.PropertyToFrame(StateView.State, PropertyName, SelectorStack); Debug.Assert(Frame != null); string Text = NodeTreeHelper.GetString(StateView.State.Node, PropertyName); Debug.Assert(Text != null); Debug.Assert(Start <= End); Debug.Assert(End <= Text.Length); Frame.Print(ControllerView.PrintContext, Text.Substring(Start, End - Start), Point.Origin); }