Public Overloads Shared Sub Unsubscribe( _ ByVal token As SubscriptionToken _ )
public static void Unsubscribe( SubscriptionToken token )
Public Overloads Shared Sub Unsubscribe( _ ByVal token As SubscriptionToken _ )
public static void Unsubscribe( SubscriptionToken token )
{
// override the Initialize and Uninitialize methods of your add-in's module to subscribe and unsubscribe to the ProjectOpenedEvent
ProjectOpenedEvent.Subscribe(OnProjectOpened); //subscribe to Project opened event
ProjectOpenedEvent.Unsubscribe(OnProjectOpened); //unsubscribe from the event as the module is unloaded
void OnProjectOpened(ProjectEventArgs obj) //Project Opened event handler
{
MessageBox.Show($"{Project.Current} has opened"); //show your message box
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)