/// <summary>
        /// Prints the selection.
        /// </summary>
        public virtual void Print()
        {
            ILayoutNodeState State       = StateView.State;
            ILayoutListInner ParentInner = State.PropertyToInner(PropertyName) as ILayoutListInner;

            Debug.Assert(ParentInner != null);

            LayoutControllerView ControllerView = StateView.ControllerView;

            Debug.Assert(ControllerView.PrintContext != null);
            ControllerView.UpdateLayout();

            Debug.Assert(StartIndex <= EndIndex);

            ILayoutNodeStateView FirstStateView = (ILayoutNodeStateView)ControllerView.StateViewTable[ParentInner.StateList[StartIndex]];
            Point Origin = FirstStateView.CellOrigin.Opposite;

            for (int i = StartIndex; i < EndIndex; i++)
            {
                ILayoutNodeStateView StateView = (ILayoutNodeStateView)ControllerView.StateViewTable[ParentInner.StateList[i]];
                Debug.Assert(RegionHelper.IsValid(StateView.ActualCellSize));

                StateView.PrintCells(Origin);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutNodeStateView"/> class.
 /// </summary>
 /// <param name="controllerView">The controller view to which this object belongs.</param>
 /// <param name="state">The node state.</param>
 public LayoutNodeStateView(ILayoutControllerView controllerView, ILayoutNodeState state)
     : base(controllerView, state)
 {
     CellOrigin     = RegionHelper.InvalidOrigin;
     CellSize       = RegionHelper.InvalidSize;
     ActualCellSize = RegionHelper.InvalidSize;
 }
        /// <summary>
        /// Handler called to refresh views.
        /// </summary>
        /// <param name="operation">Details of the operation performed.</param>
        private protected override void OnGenericRefresh(WriteableGenericRefreshOperation operation)
        {
            base.OnGenericRefresh(operation);

            ILayoutNodeState RefreshState = ((LayoutGenericRefreshOperation)operation).RefreshState;

            Debug.Assert(RefreshState != null);
            Debug.Assert(StateViewTable.ContainsKey(RefreshState));
        }
        /// <summary>
        /// Handler called every time a comment is changed in the controller.
        /// </summary>
        /// <param name="operation">Details of the operation performed.</param>
        private protected override void OnCommentChanged(WriteableChangeCommentOperation operation)
        {
            base.OnCommentChanged(operation);

            ILayoutNodeState State = ((LayoutChangeCommentOperation)operation).State;

            Debug.Assert(State != null);
            Debug.Assert(StateViewTable.ContainsKey(State));
        }
        /// <summary>
        /// Handler called every time a state is inserted in the controller.
        /// </summary>
        /// <param name="operation">Details of the operation performed.</param>
        private protected override void OnStateInserted(WriteableInsertNodeOperation operation)
        {
            base.OnStateInserted(operation);

            ILayoutNodeState ChildState = ((LayoutInsertNodeOperation)operation).ChildState;

            Debug.Assert(ChildState != null);
            Debug.Assert(StateViewTable.ContainsKey(ChildState));

            ILayoutBrowsingCollectionNodeIndex BrowsingIndex = ((LayoutInsertNodeOperation)operation).BrowsingIndex;

            Debug.Assert(ChildState.ParentIndex == BrowsingIndex);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Updates all floating sizes and positions.
        /// </summary>
        public void UpdateLayout()
        {
            if (IsInvalidated)
            {
                MeasureAndArrange();
            }

            ILayoutNodeState     RootState     = Controller.RootState;
            ILayoutNodeStateView RootStateView = (ILayoutNodeStateView)StateViewTable[RootState];

            RootStateView.UpdateActualCellsSize();
            Debug.Assert(RegionHelper.IsValid(RootStateView.ActualCellSize));
        }
        /// <summary>
        /// Handler called every time a block state is removed from the controller.
        /// </summary>
        /// <param name="operation">Details of the operation performed.</param>
        private protected override void OnBlockStateRemoved(IWriteableRemoveBlockOperation operation)
        {
            base.OnBlockStateRemoved(operation);

            ILayoutBlockState BlockState = ((ILayoutRemoveBlockOperation)operation).BlockState;

            Debug.Assert(BlockState != null);
            Debug.Assert(!BlockStateViewTable.ContainsKey(BlockState));

            Debug.Assert(!StateViewTable.ContainsKey(BlockState.PatternState));
            Debug.Assert(!StateViewTable.ContainsKey(BlockState.SourceState));

            ILayoutNodeState RemovedState = ((ILayoutRemoveBlockOperation)operation).RemovedState;

            Debug.Assert(!StateViewTable.ContainsKey(RemovedState));

            Debug.Assert(BlockState.StateList.Count == 0);
        }
        /// <summary>
        /// Handler called every time a state is inserted in the controller.
        /// </summary>
        /// <param name="operation">Details of the operation performed.</param>
        private protected override void OnStateReplaced(IWriteableReplaceOperation operation)
        {
            base.OnStateReplaced(operation);

            ILayoutNodeState NewChildState = ((ILayoutReplaceOperation)operation).NewChildState;

            Debug.Assert(NewChildState != null);
            Debug.Assert(StateViewTable.ContainsKey(NewChildState));

            ILayoutBrowsingChildIndex OldBrowsingIndex = ((ILayoutReplaceOperation)operation).OldBrowsingIndex;

            Debug.Assert(OldBrowsingIndex != null);
            Debug.Assert(NewChildState.ParentIndex != OldBrowsingIndex);

            ILayoutBrowsingChildIndex NewBrowsingIndex = ((ILayoutReplaceOperation)operation).NewBrowsingIndex;

            Debug.Assert(NewBrowsingIndex != null);
            Debug.Assert(NewChildState.ParentIndex == NewBrowsingIndex);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutCollectionInner{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 LayoutCollectionInner(ILayoutNodeState owner, string propertyName)
     : base(owner, propertyName)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutBrowseContext"/> class.
 /// </summary>
 /// <param name="state">The state that will be browsed.</param>
 public LayoutBrowseContext(ILayoutNodeState state)
     : base(state)
 {
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutSingleInner{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 LayoutSingleInner(ILayoutNodeState owner, string propertyName)
     : base(owner, propertyName)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutGenericRefreshOperation"/> class.
 /// </summary>
 /// <param name="refreshState">State in the source where to start refresh.</param>
 /// <param name="handlerRedo">Handler to execute to redo the operation.</param>
 /// <param name="handlerUndo">Handler to execute to undo the operation.</param>
 /// <param name="isNested">True if the operation is nested within another more general one.</param>
 public LayoutGenericRefreshOperation(ILayoutNodeState refreshState, Action <IWriteableOperation> handlerRedo, Action <IWriteableOperation> handlerUndo, bool isNested)
     : base(refreshState, handlerRedo, handlerUndo, isNested)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutBlockListInner{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 LayoutBlockListInner(ILayoutNodeState owner, string propertyName)
     : base(owner, propertyName)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutBlockListInner{IIndex}"/> class.
 /// </summary>
 /// <param name="owner">Parent containing the inner.</param>
 protected LayoutBlockListInner(ILayoutNodeState owner)
     : base(owner)
 {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutOptionalInner{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 LayoutOptionalInner(ILayoutNodeState owner, string propertyName)
     : base(owner, propertyName)
 {
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutPlaceholderInner{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 LayoutPlaceholderInner(ILayoutNodeState owner, string propertyName)
     : base(owner, propertyName)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutGenericRefreshOperation"/> class.
 /// </summary>
 /// <param name="refreshState">State in the source where to start refresh.</param>
 /// <param name="handlerRedo">Handler to execute to redo the operation.</param>
 /// <param name="handlerUndo">Handler to execute to undo the operation.</param>
 protected LayoutGenericRefreshOperation(ILayoutNodeState refreshState, Action <IWriteableOperation> handlerRedo, Action <IWriteableOperation> handlerUndo)
     : base(refreshState, handlerRedo, handlerUndo)
 {
 }