Tp.Integration.Ide.VisualStudio.Connect.OnDisconnection C# (CSharp) Method

OnDisconnection() public method

Receives notification that the Add-in is being unloaded.
public OnDisconnection ( ext_DisconnectMode disconnectMode, Array &custom ) : void
disconnectMode ext_DisconnectMode /// Describes how the Add-in is being unloaded. ///
custom System.Array /// Array of parameters that are host application specific. ///
return void
		public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
		{
			if (disconnectMode == ext_DisconnectMode.ext_dm_HostShutdown || disconnectMode == ext_DisconnectMode.ext_dm_UserClosed)
			{
				if (_commandBarPopup != null)
				{
					_commandBarPopup.Delete(null);
					_commandBarPopup = null;
				}
				if (_controller != null)
				{
					_controller.Dispose();
					_controller = null;
				}
				if (_listener != null)
				{
					_listener.WriteLine("Disposed");
					_listener.Dispose();
					_listener = null;
				}
			}
		}

Usage Example

		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.
		}
All Usage Examples Of Tp.Integration.Ide.VisualStudio.Connect::OnDisconnection