aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/MainView.xaml.cs
blob: 199998aa5bfd0d0a691a90c71c09db681aa085ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.FSE.LogViewer.UI.Views
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
        }
    }
}
== null) throw new ArgumentNullException("textArea"); ISegment selection = textArea.Selection.SurroundingSegment; int insertionPosition = textArea.Caret.Offset; if (selection != null) // if something is selected // use selection start instead of caret position, // because caret could be at end of selection or anywhere inside. // Removal of the selected text causes the caret position to be invalid. insertionPosition = selection.Offset + TextUtilities.GetWhitespaceAfter(textArea.Document, selection.Offset).Length; InsertionContext context = new InsertionContext(textArea, insertionPosition); using (context.Document.RunUpdate()) { if (selection != null) textArea.Document.Remove(insertionPosition, selection.EndOffset - insertionPosition); Insert(context); context.RaiseInsertionCompleted(EventArgs.Empty); } } } }