Public Overloads Shared Sub Unsubscribe( _ ByVal action As Action(Of ProjectEventArgs) _ )
public static void Unsubscribe( Action<ProjectEventArgs> action )
Parameters
- action
- The delegate that is subscribed to the event
Public Overloads Shared Sub Unsubscribe( _ ByVal action As Action(Of ProjectEventArgs) _ )
public static void Unsubscribe( Action<ProjectEventArgs> action )
{
// 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)