Пример #1
0
        private void CodeSourceTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            if (CodeSourceTreeIsCollapsing)
            {
                return;
            }

            TreeViewItem selected = (TreeViewItem)e.NewValue;

            selected.BringIntoView();
            selected.Focus();

            if (PreFilterLock.IsChecked == false)
            {
                AbstractXPathBuilder xpath = Parser.SuggestXPathFor(selected, String.Empty);
                XPathInput2.Text = string.Empty;
                XPathInput1.Text = xpath.ToString();
                ClickHistory.Add(xpath);
            }
            else
            {
                string root = XPathInput1.Text;
                AbstractXPathBuilder xpath = Parser.SuggestXPathFor(selected, root);
                XPathInput2.Text = xpath.ToString();
                ClickHistory.Add(xpath);
            }
        }