Beispiel #1
0
        public PlotWindowPane()
        {
            Caption = Resources.PlotWindowCaption;

            // this value matches with icmdShowPlotWindow's Icon in VSCT file
            BitmapImageMoniker = KnownMonikers.LineChart;

            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>();
            var historyProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IPlotHistoryProvider>();

            _plotHistory = historyProvider.GetPlotHistory(sessionProvider.GetInteractiveWindowRSession());
            _plotHistory.PlotContentProvider.Locator = this;
            _plotHistory.HistoryChanged += OnPlotHistoryHistoryChanged;

            var presenter = new XamlPresenter(_plotHistory.PlotContentProvider);

            presenter.SizeChanged += PlotWindowPane_SizeChanged;

            Content = presenter;

            // initialize toolbar. Commands are added via package
            // so they appear correctly in the top level menu as well
            // as on the plot window toolbar
            this.ToolBar = new CommandID(RGuidList.RCmdSetGuid, RPackageCommandId.plotWindowToolBarId);
        }
        public PlotWindowPane() {
            Caption = Resources.PlotWindowCaption;

            // this value matches with icmdShowPlotWindow's Icon in VSCT file
            BitmapImageMoniker = KnownMonikers.LineChart;

            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue<IRSessionProvider>();
            var historyProvider = VsAppShell.Current.ExportProvider.GetExportedValue<IPlotHistoryProvider>();

            _plotHistory = historyProvider.GetPlotHistory(sessionProvider.GetInteractiveWindowRSession());
            _plotHistory.HistoryChanged += OnPlotHistoryHistoryChanged;

            var presenter = new XamlPresenter(_plotHistory.PlotContentProvider);
            presenter.SizeChanged += PlotWindowPane_SizeChanged;
            Content = presenter;

            // initialize toolbar. Commands are added via package
            // so they appear correctly in the top level menu as well 
            // as on the plot window toolbar
            this.ToolBar = new CommandID(RGuidList.RCmdSetGuid, RPackageCommandId.plotWindowToolBarId);
        }