示例#1
0
        private void tvSearchResults_SelectedChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            Window parentWindow = Window.GetWindow(this);

            var rect = new System.Drawing.RectangleF {
                Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top
            };

            if (tvSearchResult.SelectedItem is FormattedGrepLine)
            {
                inputData.PreviewFile(tvSearchResult.SelectedItem as FormattedGrepLine, rect);
            }
            else if (tvSearchResult.SelectedItem is FormattedGrepResult)
            {
                inputData.PreviewFile(tvSearchResult.SelectedItem as FormattedGrepResult, rect);
            }
        }
示例#2
0
        private void OnSelectedItemsChanged(object sender, RoutedEventArgs e)
        {
            Window parentWindow = Window.GetWindow(this);

            var rect = new System.Drawing.RectangleF {
                Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top
            };

            if (treeView.GetValue(MultiSelectTreeView.SelectedItemsProperty) is IList items && items.Count > 0)
            {
                if (items[0] is FormattedGrepLine)
                {
                    inputData.PreviewFile(items[0] as FormattedGrepLine, rect);
                }
                else if (items[0] is FormattedGrepResult)
                {
                    inputData.PreviewFile(items[0] as FormattedGrepResult, rect);
                }
            }
        }
示例#3
0
        private void OnSelectedItemsChanged()
        {
            Window parentWindow = Window.GetWindow(this);

            var rect = new System.Drawing.RectangleF {
                Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top
            };

            if (inputData.SelectedNodes is IList items && items.Count > 0)
            {
                if (items[0] is FormattedGrepLine)
                {
                    inputData.PreviewFile(items[0] as FormattedGrepLine, rect);
                }
                else if (items[0] is FormattedGrepResult)
                {
                    inputData.PreviewFile(items[0] as FormattedGrepResult, rect);
                }
            }
        }