using EnvDTE;
using EnvDTE80;
using Extensibility;
using System;

public class LifeCycle : IDTExtensibility2
{
	private OutputWindowPane output;

	public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
	{
		DTE2 dte = (DTE2)application;

		try
		{
			this.output = dte.ToolWindows.OutputWindow.OutputWindowPanes.Item("LifeCycle");
		}
		catch
		{
			this.output = dte.ToolWindows.OutputWindow.OutputWindowPanes.Add("LifeCycle");
		}

		this.output.OutputString("OnConnection event fired\n");
	}

	public void OnStartupComplete(ref Array custom)
	{
		this.output.OutputString("OnStartupComplete event fired\n");
	}

	public void OnAddInsUpdate(ref Array custom)
	{
		this.output.OutputString("OnAddInsUpdate event fired\n");
	}

	public void OnBeginShutdown(ref Array custom)
	{
		this.output.OutputString("OnBeginShutdown event fired\n");
	}

	public void OnDisconnection(ext_DisconnectMode removeMode, ref Array custom)
	{
		this.output.OutputString("OnDisconnection event fired\n");
	}
}