Ejemplo n.º 1
0
        public VariableProvider(
            [Import(typeof(IRSessionProvider))] IRSessionProvider sessionProvider,
            [Import(typeof(IDebugSessionProvider))] IDebugSessionProvider debugSessionProvider)
        {
            if (sessionProvider == null)
            {
                throw new ArgumentNullException(nameof(sessionProvider));
            }
            if (debugSessionProvider == null)
            {
                throw new ArgumentNullException(nameof(debugSessionProvider));
            }


            RSession = sessionProvider.GetInteractiveWindowRSession();
            if (RSession == null)
            {
                throw new InvalidOperationException(Invariant($"{nameof(IRSessionProvider)} failed to return RSession for {nameof(IVariableDataProvider)}"));
            }
            RSession.Mutated += RSession_Mutated;

            IdleTimeAction.Create(() => {
                PublishAllAsync().SilenceException <Exception>().DoNotWait();
            }, 10, typeof(VariableProvider));
        }
Ejemplo n.º 2
0
 public VariableRHostScript() :
     base(VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>())
 {
     _debugSessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IDebugSessionProvider>();
 }