private static void ClearOutputWindowDebugPaneText(VisualStudioApp app) { OutputWindow window = ((EnvDTE80.DTE2)app.Dte).ToolWindows.OutputWindow; OutputWindowPane debugPane = window.OutputWindowPanes.Item("Debug"); debugPane.Clear(); }
private static OutputWindowPane PrepareOutputWindowPane(DTE2 dte) { dte.ExecuteCommand("View.Output"); OutputWindow outputWindow = dte.ToolWindows.OutputWindow; OutputWindowPane outputWindowPane = null; foreach (OutputWindowPane pane in outputWindow.OutputWindowPanes) { if (pane.Name == "MonoHelper") { outputWindowPane = pane; break; } } if (outputWindowPane == null) { outputWindowPane = outputWindow.OutputWindowPanes.Add("MonoHelper"); } outputWindowPane.Activate(); outputWindowPane.Clear(); outputWindowPane.OutputString("MonoHelper, Version 1.2\r\n"); outputWindowPane.OutputString("Copyright (C) Christopher Dresel 2015\r\n"); outputWindowPane.OutputString("\r\n"); return(outputWindowPane); }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void Execute(object sender, EventArgs e) { // コマンドハンドラなので、メインのUIスレッドから呼ばれてるはずだけど、非同期でもいいのでとりあえず考慮しない方向で検討 ThreadHelper.ThrowIfNotOnUIThread(); if (dte == null) { return; } OutputWindowPane pane = null; var paneName = "ソリューションファイルのアップロード"; foreach (var obj in dte.ToolWindows.OutputWindow.OutputWindowPanes) { pane = obj as OutputWindowPane; if (pane.Name == paneName) { break; } pane = null; } if (pane == null) { pane = dte.ToolWindows.OutputWindow.OutputWindowPanes.Add(paneName); } // 中身を空にして、出力準備を行う pane.Clear(); pane.Activate(); dte.ToolWindows.OutputWindow.Parent.Activate(); // 同期処理でまずは、アイテム列挙 var uploadSln = ListupTargetFiles(dte, pane); // ここは行った先で非同期になる UploadSolution(uploadSln); }
private OutputWindowPane PrepareOutputWindowPane() { dte.ExecuteCommand("View.Output"); OutputWindow outputWindow = dte.ToolWindows.OutputWindow; OutputWindowPane outputWindowPane = null; foreach (OutputWindowPane pane in outputWindow.OutputWindowPanes) { if (pane.Name == "MonoTools") { outputWindowPane = pane; break; } } if (outputWindowPane == null) { outputWindowPane = outputWindow.OutputWindowPanes.Add("MonoTools"); } outputWindowPane.Activate(); outputWindowPane.Clear(); outputWindowPane.OutputString($"MonoTools {App.Version} © johnshope.com 2016\r\n"); return(outputWindowPane); }
void ProcessTest(OutputWindowPane pane) { string paneText; var success = _threading.BeginInvokeAndWait("Reading pane", () => ReadTest(pane), out paneText, _unloading); if (!success) { return; } if (paneText == null || paneText.Length <= PluginManager.RESHARPER_TEST.Length) { return; } var methodName = paneText.Substring(PluginManager.RESHARPER_TEST.Length); pane.Clear(); Debug.WriteLine("Running test " + methodName); var runner = new ResharperTests(pane, _threading, _actionManager, _saManager, _solution); var result = typeof(ResharperTests).GetMethod(methodName).Invoke(runner, new object[0]); var msg = string.Format("!ReSharper{0}:{1}\r\n", methodName, result); _output.Write(msg); pane.OutputString(msg); }
public static void WriteToOutputWindow(DTE dte, string message, bool clearBefore) { try { Window win = dte.Windows.Item("{34E76E81-EE4A-11D0-AE2E-00A0C90FFFC3}"); OutputWindow comwin = (OutputWindow)win.Object; if (OWP == null) { foreach (OutputWindowPane w in comwin.OutputWindowPanes) { if (w.Name == "SharePoint Solution Deployer (SPSD)") { OWP = w; } } } if (OWP == null) { OWP = comwin.OutputWindowPanes.Add("SharePoint Solution Deployer (SPSD)"); } if (clearBefore) { OWP.Clear(); } OWP.Activate(); Application.DoEvents(); OWP.OutputString(message + Environment.NewLine); OWP.ForceItemsToTaskList(); } catch (Exception) { } }
/// <summary> /// Validates configuration and performs analysis /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> protected override void CommandClicked(object sender, EventArgs e) { Configuration config = ConfigurationProvider.Load(); if (!ValidateConfiguration(config)) { return; } OutputWindowPane outputPane = CreatePane("Dexter"); outputPane.Clear(); outputPane.Activate(); System.Threading.Tasks.Task.Run(() => { dexter = new Dexter(config); DataReceivedEventHandler writeToOutputPane = (s, e1) => outputPane.OutputString(e1.Data + Environment.NewLine); dexter.OutputDataReceived += writeToOutputPane; dexter.ErrorDataReceived += writeToOutputPane; OnAnalysisStarted(EventArgs.Empty); Result result = dexter.Analyse(); OnAnalysisFinished(EventArgs.Empty); ReportResult(result); }); }
public void Write(string text) { CreateOutputPane(Name); // Creates the OutputWindowPane if it does not already exist. if (_outputWindowPane != null) { try { _outputWindowPane.Activate(); _outputWindowPane.OutputString(text); } catch (Exception ex1) { System.Diagnostics.Debug.WriteLine("Exception writing text '" + text + "': " + ex1.ToString()); // Exceeded maximum output pane size? try { _outputWindowPane.Clear(); _outputWindowPane.OutputString(text); } catch (Exception ex2) { System.Diagnostics.Debug.WriteLine("Exception writing text '" + text + "': " + ex2.ToString()); } } } }
private static void ClearOutputWindowDebugPaneText() { OutputWindow window = ((EnvDTE80.DTE2)VSTestContext.DTE).ToolWindows.OutputWindow; OutputWindowPane debugPane = window.OutputWindowPanes.Item("Debug"); debugPane.Clear(); }
public void Clear() { if (_outputPane != null) { _outputPane.Clear(); } }
public static void ClearLog() { if (_outputWindowPane != null) { _outputWindowPane.Clear(); } }
public void Clear() { if (outputWindowPane == null) { Init(); } outputWindowPane.Clear(); }
public AbstractClassRuleCheck(DTE2 applicationObject, string extension) { _applicationObject = applicationObject; _extension = extension; _outputPane = Common.GetOutputWindowPane(applicationObject, "SuperStar"); _outputPane.Clear(); }
/// <summary> /// Constructs the WebServer, starts the web server process. /// </summary> /// <param name="outputWindowPane">Existing output pane to send web server output to.</param> /// <param name="properties">PropertyManager that is set to a valid project/platform.</param> public WebServer(OutputWindowPane outputWindowPane, PropertyManager properties) { if (outputWindowPane == null) { throw new ArgumentNullException("outputWindowPane"); } if (properties == null) { throw new ArgumentNullException("properties"); } webServerOutputPane_ = outputWindowPane; // Read port from properties, if invalid port then set to default value. int webServerPort; if (!int.TryParse(properties.WebServerPort, out webServerPort)) { webServerPort = DefaultWebServerPort; } string webServerExecutable = "python.exe"; string httpd = Path.Combine(properties.SDKRootDirectory, "examples", "httpd.py"); if (!File.Exists(httpd)) { httpd = Path.Combine(properties.SDKRootDirectory, "tools", "httpd.py"); } string webServerArguments = httpd + " --no_dir_check " + webServerPort; webServerOutputPane_.Clear(); webServerOutputPane_.OutputString(Strings.WebServerStartMessage + "\n"); webServerOutputPane_.Activate(); // Start the web server process. try { webServer_ = new System.Diagnostics.Process(); webServer_.StartInfo.CreateNoWindow = true; webServer_.StartInfo.UseShellExecute = false; webServer_.StartInfo.RedirectStandardOutput = true; webServer_.StartInfo.RedirectStandardError = true; webServer_.StartInfo.FileName = webServerExecutable; webServer_.StartInfo.Arguments = webServerArguments; webServer_.StartInfo.WorkingDirectory = properties.ProjectDirectory; webServer_.OutputDataReceived += WebServerMessageReceive; webServer_.ErrorDataReceived += WebServerMessageReceive; webServer_.Start(); webServer_.BeginOutputReadLine(); webServer_.BeginErrorReadLine(); } catch (Exception e) { webServerOutputPane_.OutputString(Strings.WebServerStartFail + "\n"); webServerOutputPane_.OutputString("Exception: " + e.Message + "\n"); } }
private void ExecuteConversion(NetVertVsProject.NetVertExecutionEnum excuteFilter) { List <NetVertVsProject> TmpProjs; TmpProjs = GetEnabledProjects(excuteFilter); if (TmpProjs.Count > 0) { FOutputPane.Clear(); FOutputPane.Activate(); FOutputPane.OutputString("==== Start Conversion of " + TmpProjs.Count.ToString() + " Projects ====" + vbCrLf); //create new converters FConverterVBCS = new VSProjectFileConverter(ConverterLanguages.VBNetToCSharp); FConverterCSVB = new VSProjectFileConverter(ConverterLanguages.CSharpToVBNet); FConverterVBCS.AfterFileProcessed += NetVertConverter_AfterFileProcessed; FConverterCSVB.AfterFileProcessed += NetVertConverter_AfterFileProcessed; //convert all projects foreach (NetVertVsProject nvp in TmpProjs) { ConvertProject(nvp); } //output summary if (FConverterVBCS.TotalProjectsCount > 0) { FOutputPane.OutputString("--------------------------------------" + vbCrLf); FOutputPane.OutputString("Summary VB.NET -> C#" + vbCrLf); FOutputPane.OutputString(FConverterVBCS.SummaryText + vbCrLf); } if (FConverterCSVB.TotalProjectsCount > 0) { FOutputPane.OutputString("--------------------------------------" + vbCrLf); FOutputPane.OutputString("Summary C# -> VB.NET" + vbCrLf); FOutputPane.OutputString(FConverterCSVB.SummaryText + vbCrLf); } FOutputPane.OutputString("==== Finish ====" + vbCrLf); } else { if (excuteFilter == NetVertVsProject.NetVertExecutionEnum.OnlyManual) { FOutputPane.Clear(); FOutputPane.Activate(); FOutputPane.OutputString("==== No Projects are Enabled for Conversion ====" + vbCrLf); } } }
static void ClearOutputWindow() { InitializeVsPaneIfNeeded(); if (_outputWindowPane == null) { return; } _outputWindowPane.Clear(); }
public void Clear() { ThreadHelper.ThrowIfNotOnUIThread(); if (outputWindowPane == null) { Init(); } outputWindowPane.Clear(); }
public override void TestSuiteStarted(TestContext context) { dte.ToolWindows.OutputWindow.Parent.Activate(); dte.ToolWindows.ErrorList.Parent.Activate(); dte.ToolWindows.OutputWindow.Parent.SetFocus(); testPane = GetOutputPane("Test"); testPane.Activate(); testPane.Clear(); SetStatusBarMessage("Testing Started"); }
private void runAnalysis(List <ConfiguredFiles> configuredFiles, OutputWindowPane outputPane, bool analysisOnSavedFile) { Debug.Assert(outputPane != null); outputPane.Clear(); foreach (var analyzer in _analyzers) { analyzer.analyze(configuredFiles, outputPane, analysisOnSavedFile); } }
public override void TestSuiteStarted() { dte.ToolWindows.OutputWindow.Parent.Activate(); dte.ToolWindows.ErrorList.Parent.Activate(); dte.ToolWindows.OutputWindow.Parent.SetFocus(); testPane = GetOutputPane("Test"); testPane.Activate(); testPane.Clear(); SetStatusBarMessage("Testing Started"); }
public void Clear() { if (window != null) { lock (windowLock) { window.Clear(); window.Activate(); } } }
/// <summary> /// Constructs the WebServer, starts the web server process. /// </summary> /// <param name="outputWindowPane">Existing output pane to send web server output to.</param> /// <param name="properties">PropertyManager that is set to a valid project/platform.</param> public WebServer(OutputWindowPane outputWindowPane, PropertyManager properties) { if (outputWindowPane == null) { throw new ArgumentNullException("outputWindowPane"); } if (properties == null) { throw new ArgumentNullException("properties"); } webServerOutputPane_ = outputWindowPane; // Read port from properties, if invalid port then set to default value. int webServerPort; if (!int.TryParse(properties.WebServerPort, out webServerPort)) { webServerPort = DefaultWebServerPort; } string webServerExecutable = "python.exe"; string httpd = Path.Combine(properties.SDKRootDirectory, "examples", "httpd.py"); if (!File.Exists(httpd)) httpd = Path.Combine(properties.SDKRootDirectory, "tools", "httpd.py"); string webServerArguments = httpd + " --no_dir_check " + webServerPort; webServerOutputPane_.Clear(); webServerOutputPane_.OutputString(Strings.WebServerStartMessage + "\n"); webServerOutputPane_.Activate(); // Start the web server process. try { webServer_ = new System.Diagnostics.Process(); webServer_.StartInfo.CreateNoWindow = true; webServer_.StartInfo.UseShellExecute = false; webServer_.StartInfo.RedirectStandardOutput = true; webServer_.StartInfo.RedirectStandardError = true; webServer_.StartInfo.FileName = webServerExecutable; webServer_.StartInfo.Arguments = webServerArguments; webServer_.StartInfo.WorkingDirectory = properties.ProjectDirectory; webServer_.OutputDataReceived += WebServerMessageReceive; webServer_.ErrorDataReceived += WebServerMessageReceive; webServer_.Start(); webServer_.BeginOutputReadLine(); webServer_.BeginErrorReadLine(); } catch (Exception e) { webServerOutputPane_.OutputString(Strings.WebServerStartFail + "\n"); webServerOutputPane_.OutputString("Exception: " + e.Message + "\n"); } }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void GenerateHTMLAssetsCallback(object sender, EventArgs e) { IVsWindowFrame windowFrame = CreateToolWindow(ToolsName.GENERATEHTMLASSETS, Guid.NewGuid().ToString(), new HTMLAssetsUC()); windowFrame.Show(); InitializeOutputWindoPane(ToolsName.GENERATEHTMLASSETS); outputWindowPane.Clear(); //string message = string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.GetType().FullName); //string title = "APToolsCommand"; /* * // Show a message box to prove we were here * VsShellUtilities.ShowMessageBox( * this.ServiceProvider, * message, * title, * OLEMSGICON.OLEMSGICON_INFO, * OLEMSGBUTTON.OLEMSGBUTTON_OK, * OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); */ }
internal void WriteOutput(string msg, bool clear = false, bool hide = false, string paneName = "Studio") { if (_outputWindowPane == null) { _outputWindowPane = GetOutputWindow(hide, paneName); } if (clear) { _outputWindowPane.Clear(); } _outputWindowPane.OutputString(msg); }
public void Clear() { //Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); if (window != null) { lock (windowLock) { window.Clear(); window.Activate(); } } }
private void runAnalysis(List <SourceFile> files, Configuration currentConfig, OutputWindowPane outputPane, bool analysisOnSavedFile) { Debug.Assert(outputPane != null); Debug.Assert(currentConfig != null); outputPane.Clear(); var currentConfigName = currentConfig.ConfigurationName; foreach (var analyzer in _analyzers) { analyzer.analyze(files, outputPane, currentConfigName.Contains("64"), currentConfigName.ToLower().Contains("debug"), analysisOnSavedFile); } }
/// <summary> /// Initializes a new instance of the <see cref="OutputWindowWriter"/> class. /// </summary> /// <param name="applicationObject">The application object.</param> public OutputWindowWriter(_DTE applicationObject) { Window window = applicationObject.Windows.Item(Constants.vsWindowKindOutput); OutputWindow outputWindow = (OutputWindow)window.Object; outputWindowPane = outputWindow.OutputWindowPanes .OfType<OutputWindowPane>() .Where(p => p.Name == "WSCF.blue") .FirstOrDefault() ?? outputWindow.OutputWindowPanes.Add("WSCF.blue"); outputWindowPane.Clear(); outputWindowPane.Activate(); }
/// <summary> /// Initializes a new instance of the <see cref="OutputWindowWriter"/> class. /// </summary> /// <param name="applicationObject">The application object.</param> public OutputWindowWriter(_DTE applicationObject) { Window window = applicationObject.Windows.Item(Constants.vsWindowKindOutput); OutputWindow outputWindow = (OutputWindow)window.Object; outputWindowPane = outputWindow.OutputWindowPanes .OfType <OutputWindowPane>() .Where(p => p.Name == "WSCF.blue") .FirstOrDefault() ?? outputWindow.OutputWindowPanes.Add("WSCF.blue"); outputWindowPane.Clear(); outputWindowPane.Activate(); }
private void CreateOutputWindow(string winText) { ow = _app.ToolWindows.OutputWindow; ow.Parent.Activate(); try { owp = ow.OutputWindowPanes.Item(winText); owp.Clear(); ow.Parent.Activate(); owp.Activate(); } catch { owp = ow.OutputWindowPanes.Add(winText); } }
/// <summary> /// Signals the helper to output that analysis has begun. /// </summary> protected override void SignalAnalysisStarted() { // Write out our header to the output window. OutputWindowPane pane = VSWindows.GetInstance(this.ServiceProvider).OutputPane; if (pane != null) { pane.Clear(); pane.Activate(); VSWindows.GetInstance(this.ServiceProvider).OutputWindow.Activate(); pane.OutputLine(string.Format( CultureInfo.InvariantCulture, Strings.MiniLogBreak, string.Format(CultureInfo.InvariantCulture, Strings.StyleCopStarted, this.VersionNumberMajorMinor, this.VersionNumberFull))); } }
private void ShowOutput(string output) { if (String.IsNullOrEmpty(output)) { return; } if (_outputPane == null) { Window window = _dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput); OutputWindow outputWindow = (OutputWindow)window.Object; _outputPane = outputWindow.OutputWindowPanes.Add("CoolFormat"); } _outputPane.Activate(); _outputPane.Clear(); _outputPane.OutputString(output); }
/// <summary> /// Initializes a new instance of the <see cref="OutputWindowWriter"/> class. /// </summary> /// <param name="applicationObject">The application object.</param> public OutputWindowWriter(_DTE applicationObject) { ThreadHelper.ThrowIfNotOnUIThread(); Window window = applicationObject.Windows.Item(Constants.vsWindowKindOutput); OutputWindow outputWindow = (OutputWindow)window.Object; outputWindowPane = outputWindow.OutputWindowPanes .OfType <OutputWindowPane>() .Where(p => { ThreadHelper.ThrowIfNotOnUIThread(); return(p.Name == "WSCF.blue"); }) .FirstOrDefault() ?? outputWindow.OutputWindowPanes.Add("WSCF.blue"); outputWindowPane.Clear(); outputWindowPane.Activate(); }
/// <summary> /// Removes existing event entries /// </summary> /// <param name="sender"> </param> /// <param name="e"> </param> private void OnPurgeEvents(object sender, EventArgs e) { try { _DTE dteObj = (_DTE)GetNodeSite().GetService(typeof(_DTE)); if (outputPane == null) { OutputWindow ouputWindow = (OutputWindow)dteObj.Windows.Item(EnvDTE.Constants.vsWindowKindOutput).Object; outputPane = ouputWindow.OutputWindowPanes.Item("{1BD8A850-02D1-11d1-bee7-00a0c913d1f8}"); } outputPane.Clear(); } catch (Exception exc) { MessageBox.Show(WMISys.GetString("WMISE_Exception", exc.Message, exc.StackTrace)); } }
private void runAnalysis(List<ConfiguredFiles> configuredFiles, OutputWindowPane outputPane, bool analysisOnSavedFile) { Debug.Assert(outputPane != null); outputPane.Clear(); foreach (var analyzer in _analyzers) { analyzer.analyze(configuredFiles, outputPane, analysisOnSavedFile); } }
private void runAnalysis(string dir, OutputWindowPane outputPane) { outputPane.Clear(); foreach (var analyzer in _analyzers) { analyzer.analyze(dir, outputPane); } }
void ProcessTest(OutputWindowPane pane) { string paneText; var success = _threading.BeginInvokeAndWait("Reading pane",()=> ReadTest(pane), out paneText, _unloading); if (!success) return; if (paneText == null || paneText.Length <= PluginManager.RESHARPER_TEST.Length) return; var methodName = paneText.Substring(PluginManager.RESHARPER_TEST.Length); pane.Clear(); Debug.WriteLine("Running test " + methodName); var runner = new ResharperTests(pane, _threading, _actionManager, _saManager, _solution); var result = typeof(ResharperTests).GetMethod(methodName).Invoke(runner, new object[0]); var msg = string.Format("!ReSharper{0}:{1}\r\n", methodName, result); _output.Write(msg); pane.OutputString(msg); }