本文整理汇总了C#中OutputWindowPane.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# OutputWindowPane.Activate方法的具体用法?C# OutputWindowPane.Activate怎么用?C# OutputWindowPane.Activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputWindowPane
的用法示例。
在下文中一共展示了OutputWindowPane.Activate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DriverUI
public DriverUI(DTE dte, Window outputWindow, OutputWindowPane pane)
{
_dte = dte;
_outputWindow = outputWindow;
_pane = pane;
_buttonTag = Guid.NewGuid().ToString();
// http://stackoverflow.com/questions/12049362/programmatically-add-add-in-button-to-the-standard-toolbar
// add a toolbar button to the standard toolbar
var bar = ((CommandBars)_dte.CommandBars)["Standard"];
if (bar != null)
{
var control = (CommandBarButton)bar.Controls.Add(MsoControlType.msoControlButton, Type.Missing, Type.Missing, Type.Missing, true);
control.Style = MsoButtonStyle.msoButtonIcon;
control.TooltipText = BarButtonControlCaption;
control.Caption = BarButtonControlCaption;
control.Tag = _buttonTag;
control.BeginGroup = true;
control.Click += (CommandBarButton ctrl, ref bool d) =>
{
_outputWindow.Visible = true;
pane.Activate();
};
}
else
{
Log.W("failed to add command button, no Standard command bar");
}
updateUI();
}
示例2: CreateOutputPane
private void CreateOutputPane()
{
_outputPane = _outputPanes.Add("IvyVisual");
if (_outputPane != null)
{
_outputPane.Activate();
}
}
示例3: TestSuiteStarted
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");
}
示例4: WebServer
/// <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");
}
}
示例5: OutputWindowWriter
/// <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();
}
示例6: OnConnection
/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
/// <param term='Application'>Root object of the host application.</param>
/// <param term='ConnectMode'>Describes how the Add-in is being loaded.</param>
/// <param term='AddInInst'>Object representing this Add-in.</param>
/// <seealso class='IDTExtensibility2' />
public void OnConnection(object Application, ext_ConnectMode ConnectMode, object AddInInst, ref Array custom)
{
applicationObject = (DTE2)Application;
addInInstance = (AddIn)AddInInst;
try
{
switch (ConnectMode)
{
case ext_ConnectMode.ext_cm_UISetup:
break;
case ext_ConnectMode.ext_cm_Startup:
break;
case ext_ConnectMode.ext_cm_AfterStartup:
AddTemporaryUI();
break;
}
theOutputPane = applicationObject.ToolWindows.OutputWindow.OutputWindowPanes.Add("Sonar Analysis");
theOutputPane.Activate();
}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
}
示例7: ExecStmt2
//one of the test methods for debugging, running against
//sqlcmd - due to bug in S2K5, where we hang wen executing
//this method causes hang as well
bool ExecStmt2(string cmdText)
{
OutputWindow ow = _app.ToolWindows.OutputWindow;
ow.Parent.Activate();
try {
owp = ow.OutputWindowPanes.Item("Debug");
}
catch {
owp = ow.OutputWindowPanes.Add("Debug");
}
try {
_app.StatusBar.Text = "Debug started";
ow.Parent.Activate();
owp.Activate();
string buildPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();
buildPath = Path.Combine(buildPath, "MSBUILD.exe");
owp.OutputString("Debug Started\n");
System.Diagnostics.Process p = new System.Diagnostics.Process();
string sqlFile = "";
//sqlcmd -d test2 -Q "select dbo.MyAdder99
sqlFile = Path.Combine(ProjectPath, "sql.proj");
//string paramString = string.Format("\"{0}\" /t:ExecDebug /p:CmdText=\"{1}\"", sqlFile, cmdText);
//p.StartInfo = new ProcessStartInfo("cmd.exe", "/k " + buildPath + " \"" + sqlFile + "\" /t:ExecDebug /p:CmdText=\"" + cmdText + "\"");
p.StartInfo = new ProcessStartInfo("sqlcmd.exe", "-d test2 -Q \"" + cmdText + "\"");
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start();
p.BeginOutputReadLine();
//owp.OutputString(p.StandardOutput.ReadToEnd());
p.WaitForExit();
owp.Activate();
string statusMsg = "succeeded";
if (p.ExitCode != 0)
statusMsg = "failed";
_app.StatusBar.Text = string.Format("Debug {0}", statusMsg);
ow.Parent.Activate();
//ow.Parent.AutoHides = true;
return true;
}
catch (Exception e) {
_app.StatusBar.Text = "Debug failed";
string msg = string.Format("An unexpected exception occured.\n\nThe exception is: {0}", e.Message);
owp.OutputString(msg);
return false;
}
finally {
}
}
示例8: CreateOutputWindow
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);
}
}
示例9: startDebugCommandEvents_BeforeExecute
/// <summary>
/// New Start Debug Command Events Before Execution Event Handler. Call the method responsible for building the app.
/// </summary>
/// <param name="Guid"> Command GUID. </param>
/// <param name="ID"> Command ID. </param>
/// <param name="CustomIn"> Custom IN Object. </param>
/// <param name="CustomOut"> Custom OUT Object. </param>
/// <param name="CancelDefault"> Cancel the default execution of the command. </param>
private void startDebugCommandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
{
bool bbPlatform = false;
if (_dte.Solution.SolutionBuild.ActiveConfiguration != null)
{
isDebugConfiguration = checkDebugConfiguration();
SolutionContexts scCollection = _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
foreach (SolutionContext sc in scCollection)
{
if (sc.PlatformName == "BlackBerry" || sc.PlatformName == "BlackBerrySimulator")
{
bbPlatform = true;
if (sc.PlatformName == "BlackBerrySimulator")
_isSimulator = true;
else
_isSimulator = false;
}
}
}
Debug.WriteLine("Before Start Debug");
if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning || !bbPlatform)
{
// Disable the override of F5 (this allows the debugged process to continue execution)
CancelDefault = false;
}
else
{
try
{
Solution2 soln = (Solution2)_dte.Solution;
buildThese = new List<String>();
_targetDir = new List<string[]>();
foreach (String startupProject in (Array)soln.SolutionBuild.StartupProjects)
{
foreach (Project p1 in soln.Projects)
{
if (p1.UniqueName == startupProject)
{
buildThese.Add(p1.FullName);
processName = p1.Name;
ConfigurationManager config = p1.ConfigurationManager;
Configuration active = config.ActiveConfiguration;
foreach (Property prop in active.Properties)
{
try
{
if (prop.Name == "OutputPath")
{
string[] path = new string[2];
path[0] = p1.Name;
path[1] = prop.Value.ToString();
_targetDir.Add(path);
break;
}
}
catch
{
}
}
break;
}
}
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
// Create a reference to the Output window.
// Create a tool window reference for the Output window
// and window pane.
OutputWindow ow = ((DTE2)_dte).ToolWindows.OutputWindow;
// Select the Build pane in the Output window.
_owP = ow.OutputWindowPanes.Item("Build");
_owP.Activate();
if (isDebugConfiguration)
{
UpdateManagerData upData;
if (_targetDir.Count > 0)
upData = new UpdateManagerData(_targetDir[0][1]);
else
upData = new UpdateManagerData();
//.........这里部分代码省略.........
示例10: ProvisionProject
private void ProvisionProject(DTE2 dte, OutputWindowPane activePane, Project targetProject)
{
string classpathFile = Path.GetDirectoryName(targetProject.FullName) + "\\.classpath";
if (!File.Exists(classpathFile))
{
activePane.Activate();
activePane.OutputString("File not found: .classpath. A provisioning build needs to complete successfully first\n");
return;
}
var doc = new XmlDocument();
doc.Load(classpathFile);
var entries = doc.GetElementsByTagName("classpathentry");
// filter entries by kind = "lib"
for (int i = 0; i < entries.Count; ++i)
{
var node = entries.Item(i);
var path = node.Attributes["path"];
var type = node.Attributes["kind"];
if (path != null)
{
if (type != null && type.Value.Equals("lib"))
{
AddReferenceToProject(targetProject, path.Value.EndsWith(".jar") ? path.Value : path.Value + "/", activePane);
}
}
}
targetProject.Save();
}
示例11: Connect
/// <summary>
/// Run initialization code on first connection of the AddIn
/// </summary>
/// <param name="appObj">Application Object</param>
/// <param name="addin">Add In Object</param>
public void Connect(DTE2 appObj, EnvDTE.AddIn addin)
{
/// Initialize External and Internal Variables.
_applicationObject = appObj;
_addInInstance = addin;
isDebugEngineRunning = false;
/// Register Command Events
_commandEvents = new VSNDKCommandEvents(appObj);
_commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionPlatform, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec);
_commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionCfg, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec);
_commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartDebug, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute);
_commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidStartDebugContext, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute);
_commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartNoDebug, startNoDebugCommandEvents_AfterExecute, startNoDebugCommandEvents_BeforeExecute);
_commandEvents.RegisterCommand(GuidList.guidVSDebugGroup, CommandConstants.cmdidDebugBreakatFunction, cmdNewFunctionBreakpoint_afterExec, cmdNewFunctionBreakpoint_beforeExec);
// ??? Check why Solution.SolutionBuild.Deploy(false) fires OnBuildComplete event immediately after start deploying when _buildEvents is initialized here.
// ??? To avoid that, we should initialize _buildEvents in BuildBar(), but here should be the right place.
_buildEvents = _applicationObject.Events.BuildEvents;
_buildEvents.OnBuildBegin += new _dispBuildEvents_OnBuildBeginEventHandler(this.OnBuildBegin);
// Create a reference to the Output window.
// Create a tool window reference for the Output window
// and window pane.
OutputWindow ow = _applicationObject.ToolWindows.OutputWindow;
// Select the Build pane in the Output window.
_owP = ow.OutputWindowPanes.Item("Build");
_owP.Activate();
DisableIntelliSenseErrorReport(true);
CheckSolutionPlatformCommand();
}
示例12: startDebugCommandEvents_BeforeExecute
/// <summary>
/// New Start Debug Command Events Before Execution Event Handler. Call the method responsible for building the app.
/// </summary>
/// <param name="Guid"> Command GUID. </param>
/// <param name="ID"> Command ID. </param>
/// <param name="CustomIn"> Custom IN Object. </param>
/// <param name="CustomOut"> Custom OUT Object. </param>
/// <param name="CancelDefault"> Cancel the default execution of the command. </param>
private void startDebugCommandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
{
bool bbPlatform = false;
if (_dte.Solution.SolutionBuild.ActiveConfiguration != null)
{
SolutionContexts scCollection = _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
foreach (SolutionContext sc in scCollection)
{
if (sc.PlatformName == "BlackBerry" || sc.PlatformName == "BlackBerrySimulator")
{
bbPlatform = true;
if (sc.PlatformName == "BlackBerrySimulator")
_isSimulator = true;
else
_isSimulator = false;
}
}
}
Debug.WriteLine("Before Start Debug");
if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning || !bbPlatform)
{
// Disable the override of F5 (this allows the debugged process to continue execution)
CancelDefault = false;
}
else
{
// Create a reference to the Output window.
// Create a tool window reference for the Output window
// and window pane.
OutputWindow ow = ((DTE2)_dte).ToolWindows.OutputWindow;
// Select the Build pane in the Output window.
_owP = ow.OutputWindowPanes.Item("Build");
_owP.Activate();
UpdateManagerData upData = new UpdateManagerData(this);
if (!upData.validateDeviceVersion(_isSimulator))
{
CancelDefault = true;
}
else
{
BuildBar();
CancelDefault = true;
}
}
}