The object for implementing an Add-in.
Inheritance: IDTExtensibility2, IDTCommandTarget
		public void TestUiSetupModeConnect()
		{
			var connect = new Connect();
			Array array = null;
			connect.OnConnection(null, ext_ConnectMode.ext_cm_UISetup, null, ref array); // Do nothing.
			connect.OnDisconnection(ext_DisconnectMode.ext_dm_UISetupComplete, ref array); // Do nothing.
		}
		public void TestStartupModeConnect()
		{
			var mocks = new MockRepository();

			var form = new Form(); // Visual Studio main window.
			var toolWindowControl = new ToolWindowControl {Dock = DockStyle.Fill}; // To Do tool window control.
			form.Controls.Add(toolWindowControl);
			DTE2 application;
			AddIn addin;

			using (mocks.Record())
			{
				MockDte(mocks, form, toolWindowControl, out application, out addin);
			}

			var settings = new Settings
			               	{
			               		Uri = new Uri("http://localhost/tp2"),
			               		Login = "******",
			               		DecryptedPassword = "******",
			               		AutoLogin = true,
			               		AutoRefresh = false,
			               	};
			settings.Save();

			using (mocks.Playback())
			{
				Array array = null;

				// Create addin instance.
				var connect = new Connect();

				Console.WriteLine("Test started");

				// Display Visual Studio main window.
				form.Show();

				// Connect addin instance to Visual Studio.
				connect.OnConnection(application, ext_ConnectMode.ext_cm_Startup, addin, ref array);
				connect.OnStartupComplete(ref array);

				// Check command statuses.
				vsCommandStatus status = vsCommandStatus.vsCommandStatusUnsupported;
				object tmp = null;

				connect.QueryStatus(addin.ProgID + "." + Connect.CmdLogin, vsCommandStatusTextWanted.vsCommandStatusTextWantedNone,
				                    ref status, ref tmp);
				Assert.AreEqual(vsCommandStatus.vsCommandStatusSupported, status);

				connect.QueryStatus(addin.ProgID + "." + Connect.CmdLogout, vsCommandStatusTextWanted.vsCommandStatusTextWantedNone,
				                    ref status, ref tmp);
				Assert.AreEqual(vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled, status);

				connect.QueryStatus(addin.ProgID + "." + Connect.CmdToDoList,
				                    vsCommandStatusTextWanted.vsCommandStatusTextWantedNone, ref status, ref tmp);
				Assert.AreEqual(vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled, status);

				connect.QueryStatus(addin.ProgID + "." + Connect.CmdOptions, vsCommandStatusTextWanted.vsCommandStatusTextWantedNone,
				                    ref status, ref tmp);
				Assert.AreEqual(vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled, status);

				// Execute some commands.
				bool handled = false;
				connect.Exec(addin.ProgID + "." + Connect.CmdToDoList, vsCommandExecOption.vsCommandExecOptionDoDefault, ref tmp,
				             ref tmp, ref handled);
				Assert.IsTrue(handled);

				form.Closed += (sender, e) =>
				               	{
				               		// Disconnect addin instance from Visual Studio.
				               		connect.OnDisconnection(ext_DisconnectMode.ext_dm_HostShutdown, ref array);
				               		Console.WriteLine("Test ended");
				               	};
				Application.Run(form);
			}
		}