public InteractiveWindow(string title, AutomationElement element, VisualStudioApp app) : base(null, element) { _app = app; _title = title; var compModel = _app.GetService <IComponentModel>(typeof(SComponentModel)); var replWindowProvider = compModel.GetService <InteractiveWindowProvider>(); _replWindow = replWindowProvider #if DEV14_OR_LATER .AllOpenWindows #else .GetReplWindows() #endif .OfType <ToolWindowPane>() .FirstOrDefault(p => p.Caption.Equals(title, StringComparison.CurrentCulture)); #if DEV14_OR_LATER _interactive = ((IVsInteractiveWindow)_replWindow).InteractiveWindow; #else _interactive = (IReplWindow)_replWindow; #endif _replWindowInfo = _replWindows.GetValue(_replWindow, window => { var info = new InteractiveWindowInfo(); _interactive.ReadyForInput += new Action(info.OnReadyForInput); return(info); }); }
public InteractiveWindow(string title, AutomationElement element, VisualStudioApp app) : base(null, element) { _app = app; _title = title; var compModel = _app.GetService<IComponentModel>(typeof(SComponentModel)); var replWindowProvider = compModel.GetService<InteractiveWindowProvider>(); _replWindow = replWindowProvider #if DEV14_OR_LATER .GetReplToolWindows() #else .GetReplWindows() #endif .OfType<ToolWindowPane>() .FirstOrDefault(p => p.Caption.Equals(title, StringComparison.CurrentCulture)); #if DEV14_OR_LATER _interactive = ((IVsInteractiveWindow)_replWindow).InteractiveWindow; #else _interactive = (IReplWindow)_replWindow; #endif _replWindowInfo = _replWindows.GetValue(_replWindow, window => { var info = new InteractiveWindowInfo(); _interactive.ReadyForInput += new Action(info.OnReadyForInput); return info; }); }
public Task<ExecutionResult> Execute(IInteractiveWindow window, string arguments) { var remoteEval = window.Evaluator as IMultipleScopeEvaluator; Debug.Assert(remoteEval != null, "Evaluator does not support switching scope"); if (remoteEval != null) { remoteEval.SetScope(arguments); } return ExecutionResult.Succeeded; }
public Task <ExecutionResult> Execute(IInteractiveWindow window, string arguments) { var remoteEval = window.Evaluator as IMultipleScopeEvaluator; Debug.Assert(remoteEval != null, "Evaluator does not support switching scope"); if (remoteEval != null) { remoteEval.SetScope(arguments); } return(ExecutionResult.Succeeded); }
internal ReplWindowProxy(VisualStudioApp app, IInteractiveWindow window, ToolWindowPane toolWindow, ReplWindowProxySettings settings) { Assert.IsNotNull(app, "app is required"); Assert.IsNotNull(window, "window is required"); _app = app; _window = window; _toolWindow = toolWindow; _settings = settings; _replWindowInfo = _replWindows.GetOrCreateValue(toolWindow); _window.ReadyForInput += _replWindowInfo.OnReadyForInput; _editorOperations = _app.ComponentModel.GetService <IEditorOperationsFactoryService>() .GetEditorOperations(_window.TextView); }