Exemplo n.º 1
0
 public void CleanUp()
 {
     Workspace.CleanUpWaitingService();
     Workspace.CleanUpWorkspace();
     SolutionExplorer.CleanUpOpenSolution();
     InteractiveWindow.CloseInteractiveWindow();
 }
Exemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try {
                    InteractiveWindow.CloseAll(this);
                } catch (Exception ex) {
                    Console.WriteLine("Error while closing all interactive windows");
                    Console.WriteLine(ex);
                }

                if (_deletePerformanceSessions)
                {
                    try {
                        dynamic profiling = Dte.GetObject("PythonProfiling");

                        for (dynamic session = profiling.GetSession(1);
                             session != null;
                             session = profiling.GetSession(1))
                        {
                            profiling.RemoveSession(session, true);
                        }
                    } catch (Exception ex) {
                        Console.WriteLine("Error while cleaning up profiling sessions");
                        Console.WriteLine(ex);
                    }
                }
            }
            base.Dispose(disposing);
        }
Exemplo n.º 3
0
        public static int OpenUI(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args)
        {
            string[] arguments = args.Split(" ".ToCharArray());
            bool     showModal = false;

            if (arguments.Length > 0 && !bool.TryParse(arguments[0], out showModal))
            {
                showModal = false;
            }

            try
            {
                IDebugClient debugClient = (IDebugClient)Marshal.GetUniqueObjectForIUnknown(client);

                DbgEngDll.InitializeContext(debugClient);
                new Task(() =>
                {
                    if (showModal)
                    {
                        InteractiveWindow.ShowModalWindow();
                    }
                    else
                    {
                        InteractiveWindow.ShowWindow();
                    }
                }).Start();
                return(0);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return(ex.HResult);
            }
        }
Exemplo n.º 4
0
        public CSharpInteractiveDemo(VisualStudioInstanceFactory instanceFactory)
        {
            _visualStudio = instanceFactory.GetNewOrUsedInstance();

            _interactiveWindow = _visualStudio.Instance.CSharpInteractiveWindow;

            _interactiveWindow.ShowAsync().GetAwaiter().GetResult();
            _interactiveWindow.ResetAsync().GetAwaiter().GetResult();
        }
Exemplo n.º 5
0
 public void VerifyReturnIndentCurrentLine()
 {
     InteractiveWindow.ClearScreen();
     SendKeys(" (");
     SendKeys(")");
     SendKeys(VirtualKey.Left);
     SendKeys(VirtualKey.Enter);
     VerifyCaretPosition(12);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Click on the camera will display a capture window
 /// </summary>
 private void cameraImage_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (!(tableManager.InputManager.InteractiveWindow != null && tableManager.InputManager.InteractiveWindow.IsVisible))
     {
         InteractiveWindow intWin = new InteractiveWindow();
         intWin.Owner = CommonAttribService.mainWindow;
         tableManager.InputManager.InteractiveWindow = intWin;
         intWin.Show();
     }
 }
Exemplo n.º 7
0
        public OutputBuffer(InteractiveWindow window)
        {
            Reset();

            this.mutex  = new object();
            this.window = window;

            this.timer          = new DispatcherTimer();
            this.timer.Tick    += (sender, args) => Flush();
            this.timer.Interval = TimeSpan.FromMilliseconds(AutoFlushMilliseconds);
        }
Exemplo n.º 8
0
        public ISmartIndent CreateSmartIndent(ITextView view)
        {
            var window = InteractiveWindow.FromBuffer(view.TextBuffer);

            if (window == null || window.CurrentLanguageBuffer == null)
            {
                return(null);
            }

            return(InteractiveSmartIndenter.Create(this.indentProviders, window.CurrentLanguageBuffer.ContentType, view));
        }
Exemplo n.º 9
0
 /// <summary>
 /// Shows the interactive window.
 /// </summary>
 /// <param name="modal">if set to <c>true</c> window will be shown as modal dialog.</param>
 public static void ShowInteractiveWindow(bool modal)
 {
     if (modal)
     {
         InteractiveWindow.ShowModalWindow();
     }
     else
     {
         InteractiveWindow.ShowWindow();
     }
 }
Exemplo n.º 10
0
        public void CleanUp()
        {
            Workspace.CleanUpWaitingService();
            Workspace.CleanUpWorkspace();
            SolutionExplorer.CleanUpOpenSolution();

            // Close any windows leftover from previous (failed) tests
            InteractiveWindow.CloseInteractiveWindow();
            ChangeSignatureDialog.CloseWindow();
            GenerateTypeDialog.CloseWindow();
            ExtractInterfaceDialog.CloseWindow();
        }
Exemplo n.º 11
0
 protected override void Dispose(bool disposing)
 {
     if (!IsDisposed)
     {
         try {
             InteractiveWindow.CloseAll(this);
         } catch (Exception ex) {
             Console.WriteLine("Error while closing all interactive windows");
             Console.WriteLine(ex);
         }
     }
     base.Dispose(disposing);
 }
Exemplo n.º 12
0
        public void TypingHelpDirectiveWorks()
        {
            InteractiveWindow.ShowWindow(waitForPrompt: true);

            // Directly type #help, rather than sending it through SubmitText. We want to actually test
            // that completion doesn't interfere and there aren't problems with the content-type switching.
            VisualStudio.Instance.SendKeys.Send("#help");

            Assert.EndsWith("#help", InteractiveWindow.GetReplText());

            VisualStudio.Instance.SendKeys.Send("\n");
            InteractiveWindow.WaitForReplOutputContains("REPL commands");
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            Options options = null;

            Parser.Default.ParseArguments <Options>(args)
            .WithParsed(o => options = o);

            if (options == null)
            {
                return;
            }

            DebuggerInitialization.OpenDump(options.DumpPath, options.SymbolPath);
            InteractiveWindow.ShowModalWindow();
        }
Exemplo n.º 14
0
        public void CleanUp()
        {
            Workspace.CleanUpWaitingService();
            Workspace.CleanUpWorkspace();
            SolutionExplorer.CleanUpOpenSolution();
            Workspace.WaitForAllAsyncOperations();

            // Close any windows leftover from previous (failed) tests
            InteractiveWindow.CloseInteractiveWindow();
            ObjectBrowserWindow.CloseWindow();
            ChangeSignatureDialog.CloseWindow();
            GenerateTypeDialog.CloseWindow();
            ExtractInterfaceDialog.CloseWindow();
            StartPage.CloseWindow();

            // Prevent the start page from showing after each solution closes
            StartPage.SetEnabled(false);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Gets the interactive window associated with the text buffer if the text
 /// buffer is being hosted in the interactive window.
 ///
 /// Returns null if the text buffer is not hosted in the interactive window.
 /// </summary>
 public static IInteractiveWindow GetInteractiveWindow(this ITextBuffer buffer)
 {
     return(InteractiveWindow.FromBuffer(buffer));
 }
Exemplo n.º 16
0
 void IVsInteractiveWindow.SetLanguage(Guid languageServiceGuid, IContentType contentType) =>
 InteractiveWindow.SetLanguage(languageServiceGuid, contentType);