Beispiel #1
0
        public void FlipSide()
        {
            ExpressionSide = ExpressionSide == ExpressionSide.Left ?
                             ExpressionSide.Right : ExpressionSide.Left;

            if (ActiveExpression == null)
            {
                return;
            }

            Point position;

            if (ExpressionSide == ExpressionSide.Left)
            {
                position = ActiveExpression.RightPositionOf();
            }
            else
            {
                position = ActiveExpression.LeftPositionOf();
            }
            Left = position.X;
        }
Beispiel #2
0
        public void UpdateActiveExpression()
        {
            Point position = default(Point);

            if (ExpressionSide == ExpressionSide.Left)
            {
                position = ActiveExpression.LeftPositionOf();
            }
            else
            {
                position = ActiveExpression.RightPositionOf();
            }

            Left        = position.X;
            Top         = position.Y;
            CaretHeight = ActiveExpression.ActualHeight;

            // If the active expression's height is zero (most probably not available at this moment
            // or not calculated) set the caret height to nonzero number just so that the Caret is visible.
            if (CaretHeight == 0)
            {
                CaretHeight = 18;
            }
        }