示例#1
0
        private void _dataView_OnCellSelected(object sender, CellSelectedEventArgs e)
        {
            TextPosition pos    = e.Cell.GetStructDef().Position;
            TextPosition endPos = e.Cell.GetStructDef().EndPosition;
            IDocument    doc    = _structEditControl.Document;

            if (_currentCellMarker != null)
            {
                doc.MarkerStrategy.RemoveMarker(_currentCellMarker);
            }
            int offset    = doc.PositionToOffset(new Point(pos.Col, pos.Line - 1));
            int endOffset = doc.PositionToOffset(new Point(endPos.Col, endPos.Line - 1));

            if (offset != endOffset)
            {
                _currentCellMarker = new TextMarker(offset, endOffset - offset, TextMarkerType.SolidBlock,
                                                    Color.LightSkyBlue);
                doc.MarkerStrategy.AddMarker(_currentCellMarker);
            }
            _structEditControl.ActiveTextAreaControl.ScrollTo(pos.Line - 1);
            _structEditControl.Refresh();
        }
示例#2
0
        private void _dataView_OnCellSelected(object sender, CellSelectedEventArgs e)
        {
            TextPosition pos = e.Cell.GetStructDef().Position;
            TextPosition endPos = e.Cell.GetStructDef().EndPosition;
            IDocument doc = _structEditControl.Document;

            if (_currentCellMarker != null)
                doc.MarkerStrategy.RemoveMarker(_currentCellMarker);
            int offset = doc.PositionToOffset(new Point(pos.Col, pos.Line-1));
            int endOffset = doc.PositionToOffset(new Point(endPos.Col, endPos.Line - 1));
            if (offset != endOffset)
            {
                _currentCellMarker = new TextMarker(offset, endOffset - offset, TextMarkerType.SolidBlock,
                                                    Color.LightSkyBlue);
                doc.MarkerStrategy.AddMarker(_currentCellMarker);
            }
            _structEditControl.ActiveTextAreaControl.ScrollTo(pos.Line-1);
            _structEditControl.Refresh();
        }