Example #1
0
        public ReplWindowProxy GetInteractiveWindow(string title, PythonReplWindowProxySettings settings = null)
        {
            var iwp    = GetService <IComponentModel>(typeof(SComponentModel))?.GetService <InteractiveWindowProvider>();
            var window = iwp?.AllOpenWindows.FirstOrDefault(w => ((ToolWindowPane)w).Caption == title);

            if (window == null)
            {
                Trace.TraceWarning(
                    "Failed to find {0} in {1}",
                    title,
                    string.Join(", ", iwp?.AllOpenWindows.Select(w => ((ToolWindowPane)w).Caption) ?? Enumerable.Empty <string>())
                    );
                return(null);
            }
            return(new ReplWindowProxy(this, window.InteractiveWindow, (ToolWindowPane)window, settings ?? new PythonReplWindowProxySettings()));
        }
Example #2
0
        public ReplWindowProxy WaitForInteractiveWindow(string title, PythonReplWindowProxySettings settings = null)
        {
            var iwp = GetService <IComponentModel>(typeof(SComponentModel))?.GetService <InteractiveWindowProvider>();
            IVsInteractiveWindow window = null;

            for (int retries = 20; retries > 0 && window == null; --retries)
            {
                System.Threading.Thread.Sleep(100);
                window = iwp?.AllOpenWindows.FirstOrDefault(w => ((ToolWindowPane)w).Caption == title);
            }
            if (window == null)
            {
                Trace.TraceWarning(
                    "Failed to find {0} in {1}",
                    title,
                    string.Join(", ", iwp?.AllOpenWindows.Select(w => ((ToolWindowPane)w).Caption) ?? Enumerable.Empty <string>())
                    );
                return(null);
            }
            return(new ReplWindowProxy(this, window.InteractiveWindow, (ToolWindowPane)window, settings ?? new PythonReplWindowProxySettings()));
        }
Example #3
0
 public ReplWindowProxy GetInteractiveWindow(Project project, PythonReplWindowProxySettings settings = null)
 {
     return(GetInteractiveWindow(project.Name + " Interactive", settings));
 }
Example #4
0
 public ReplWindowProxy ExecuteInInteractive(Project project, PythonReplWindowProxySettings settings = null)
 {
     OpenSolutionExplorer().SelectProject(project);
     ExecuteCommand("Python.ExecuteInInteractive");
     return(GetInteractiveWindow(project));
 }
Example #5
0
 public ReplWindowProxy WaitForInteractiveWindow(string title, PythonReplWindowProxySettings settings = null)
 {
     var iwp = GetService<IComponentModel>(typeof(SComponentModel))?.GetService<InteractiveWindowProvider>();
     IVsInteractiveWindow window = null;
     for (int retries = 20; retries > 0 && window == null; --retries) {
         System.Threading.Thread.Sleep(100);
         window = iwp?.AllOpenWindows.FirstOrDefault(w => ((ToolWindowPane)w).Caption == title);
     }
     if (window == null) {
         Trace.TraceWarning(
             "Failed to find {0} in {1}",
             title,
             string.Join(", ", iwp?.AllOpenWindows.Select(w => ((ToolWindowPane)w).Caption) ?? Enumerable.Empty<string>())
         );
         return null;
     }
     return new ReplWindowProxy(this, window.InteractiveWindow, (ToolWindowPane)window, settings ?? new PythonReplWindowProxySettings());
 }
Example #6
0
 public ReplWindowProxy GetInteractiveWindow(string title, PythonReplWindowProxySettings settings = null)
 {
     var iwp = GetService<IComponentModel>(typeof(SComponentModel))?.GetService<InteractiveWindowProvider>();
     var window = iwp?.AllOpenWindows.FirstOrDefault(w => ((ToolWindowPane)w).Caption == title);
     if (window == null) {
         Trace.TraceWarning(
             "Failed to find {0} in {1}",
             title,
             string.Join(", ", iwp?.AllOpenWindows.Select(w => ((ToolWindowPane)w).Caption) ?? Enumerable.Empty<string>())
         );
         return null;
     }
     return new ReplWindowProxy(this, window.InteractiveWindow, (ToolWindowPane)window, settings ?? new PythonReplWindowProxySettings());
 }
Example #7
0
 public ReplWindowProxy GetInteractiveWindow(Project project, PythonReplWindowProxySettings settings = null)
 {
     return GetInteractiveWindow(project.Name + " Interactive", settings);
 }
Example #8
0
 public ReplWindowProxy ExecuteInInteractive(Project project, PythonReplWindowProxySettings settings = null)
 {
     OpenSolutionExplorer().SelectProject(project);
     ExecuteCommand("Python.ExecuteInInteractive");
     return GetInteractiveWindow(project);
 }