示例#1
0
        public async Task PlotALot()
        {
            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>();
            var app             = new RHostClientPlotTestApp();

            using (var script = new RHostScript(sessionProvider, app)) {
                var history = new PlotHistory(script.Session);
                app.History = history;

                foreach (var c in _commands)
                {
                    using (var interaction = await script.Session.BeginInteractionAsync()) {
                        await interaction.RespondAsync(c + Environment.NewLine);

                        EventsPump.DoEvents(100);
                    }
                }

                for (int i = _commands.Length - 1; i >= 0; i--)
                {
                    await history.PlotContentProvider.PreviousPlotAsync();

                    EventsPump.DoEvents(100);
                }

                for (int i = 0; i < _commands.Length; i++)
                {
                    await history.PlotContentProvider.NextPlotAsync();

                    EventsPump.DoEvents(500);
                }

                EventsPump.DoEvents(1000);
            }
        }
示例#2
0
        public async Task PlotALot() {
            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue<IRSessionProvider>();
            var app = new RHostClientPlotTestApp();
            using (var script = new RHostScript(sessionProvider, app)) {
                var history = new PlotHistory(script.Session);
                app.History = history;

                foreach (var c in _commands) {
                    using (var interaction = await script.Session.BeginInteractionAsync()) {
                        try {
                            await interaction.RespondAsync(c + Environment.NewLine);
                            EventsPump.DoEvents(100);
                        } catch (RException) { }
                    }
                }

                for (int i = _commands.Length - 1; i >= 0; i--) {
                    try {
                        await history.PlotContentProvider.PreviousPlotAsync();
                        EventsPump.DoEvents(100);
                    } catch (RException) { }
                }

                for (int i = 0; i < _commands.Length; i++) {
                    try {
                        await history.PlotContentProvider.NextPlotAsync();
                        EventsPump.DoEvents(500);
                    } catch (RException) { }
                }

                EventsPump.DoEvents(1000);
            }
        }