/// <summary>
        /// 
        /// </summary>
        public RegexEditorDialog(IWpfTextViewHost regexEditor)
        {
            InitializeComponent();

            this.regexEditor = regexEditor;
            TextViewEventManager textViewEventManager = this.regexEditor.TextView.Properties.GetProperty<TextViewEventManager>(TextViewEventManager.Key);
            textViewEventManager.IntellisenseSessionStart += new EventHandler(OnIntellisenseSessionStart);
            textViewEventManager.IntellisenseSessionEnd += new EventHandler(OnIntellisenseSessionEnd);

            context = new RegexDataContext();
            context.RegexRepositoryService = new RegexRepositoryService();
            context.SelectedItem = context.RegexRepositoryService.CreateItem("[new]", string.Empty);

            this.expressionContainer.Children.Add(regexEditor.HostControl);

            this.DataContext = context;

            this.regexEditor.TextView.Caret.MoveTo(new SnapshotPoint(this.regexEditor.TextView.TextBuffer.CurrentSnapshot, this.regexEditor.TextView.TextBuffer.CurrentSnapshot.Length));
            this.regexEditor.HostControl.Focus();
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        public RegexEditorDialog(IWpfTextViewHost regexEditor)
        {
            InitializeComponent();

            this.regexEditor = regexEditor;
            TextViewEventManager textViewEventManager = this.regexEditor.TextView.Properties.GetProperty <TextViewEventManager>(TextViewEventManager.Key);

            textViewEventManager.IntellisenseSessionStart += new EventHandler(OnIntellisenseSessionStart);
            textViewEventManager.IntellisenseSessionEnd   += new EventHandler(OnIntellisenseSessionEnd);

            context = new RegexDataContext();
            context.RegexRepositoryService = new RegexRepositoryService();
            context.SelectedItem           = context.RegexRepositoryService.CreateItem("[new]", string.Empty);

            this.expressionContainer.Children.Add(regexEditor.HostControl);

            this.DataContext = context;

            this.regexEditor.TextView.Caret.MoveTo(new SnapshotPoint(this.regexEditor.TextView.TextBuffer.CurrentSnapshot, this.regexEditor.TextView.TextBuffer.CurrentSnapshot.Length));
            this.regexEditor.HostControl.Focus();
        }