Beispiel #1
0
        private static void Preview(EnvDTE.DTE dte, string file, int line)
        {
            //Window window = dte.Windows.Item("{9DDABE98-1D02-11D3-89A1-00C04F688DDE}");
            //window.Activate();
            //dte.MainWindow.SetKind(vsWindowType.vsWindowTypePreview);

            Window prev = new PreviewWindow();

            file = $"\"{file}\"";
            Console.WriteLine("Opening file: " + file + " on line: " + line);
            prev.Visible     = true;
            prev.WindowState = vsWindowState.vsWindowStateNormal;
            prev.Activate();
            //dte.ExecuteCommand("File.OpenFile", file);
            //dte.ExecuteCommand("Edit.GoTo", line.ToString());
        }
Beispiel #2
0
        public void Show(ICollectionView fractalCollection)
        {
            if (_viewModel == null || !Object.ReferenceEquals(_viewModel.FractalCollection, fractalCollection))
            {
                _viewModel = new PreviewWindowViewModel(fractalCollection);
            }

            if (_window == null || !_window.IsLoaded)
            {
                _viewModel.Plot  = null;
                _viewModel.Title = String.Empty;
                _window          = new PreviewWindow {
                    DataContext = _viewModel
                };
                _window.Show();
            }
            else
            {
                _window.DataContext = _viewModel;
                _window.Activate();
            }

            _viewModel.RenderFractal();
        }