How to get list of Triggering event similar to the one in alarm definition ?

I want to create an admin plugin able to subscribe to any Event Type, and i want to do something similar to the Triggering event in alarms :

The This first list shows both system-related events and events from plug-ins (for example access control systems or similar).

From the second list, select the event message to use when the alarm is triggered.

Regards,

Florent

I have an idea that what you ask you will see if you explore the Config API Client sample, please test it.

https://doc.developer.milestonesys.com/html/index.html?base=samples/configapiclient.html&tree=tree_2.html

If someone need to do the same, i did it like this :

ManagementServer managementServer = new ManagementServer(EnvironmentManager.Instance.MasterSite);
 
        AlarmDefinitionFolder alarmFolder = managementServer.AlarmDefinitionFolder;
        ServerTask task = alarmFolder.AddAlarmDefinition();
 
			if (task.State == StateEnum.Success)
			{
 
				List<VideoOS.ConfigurationApi.ClientService.ValueTypeInfo> EventTypeGroup = task.GetValueTypeInfoList("EventTypeGroup");
        task.SetProperty("EventTypeGroup", EventTypeGroup[7].Value);
 
				task.ValidateItem();
				List<VideoOS.ConfigurationApi.ClientService.ValueTypeInfo> EventType = task.GetValueTypeInfoList("EventType");

Regards,

Florent

Thank you for sharing your code.