コード例 #1
0
ファイル: TextBox.cs プロジェクト: JianwenSun/cc
        //------------------------------------------------------
        //
        //  Private Methods
        //
        //------------------------------------------------------

        #region Private Methods

        // Returns false if no layout is available.
        private bool GetRectangleFromTextPositionInternal(TextPointer position, bool relativeToTextBox, out Rect rect)
        {
            if (this.RenderScope == null)
            {
                rect = Rect.Empty;
                return false;
            }

            if (position.ValidateLayout())
            {
                rect = TextPointerBase.GetCharacterRect(position, position.LogicalDirection, relativeToTextBox);
            }
            else
            {
                rect = Rect.Empty;
            }

            return rect != Rect.Empty;
        }