Create a new instance of a specified implemented trigger class.
Object of the given trigger class or null.
This function create a new instance of the given trigger class specified as type string.
Firstly the type of the trigger class will be searched in the executing assembly but if no matching type exists there all loaded assemblies will be searched if access is granted.
Exception Type | Condition |
---|---|
ArgumentNullException | Thrown if no type was given. |
TypeLoadException | Means that the given type was not found in all loaded assemblies. |
// Try to create instance of a trigger and configure it try { ITrigger dailyTrigger = Trigger.Create("uws.Triggers.DailyTrigger"); dailyTrigger.Configure(xmlElement); if (dailyTrigger.Start() == true) { Console.WriteLine("Trigger was started"); } else { Console.WriteLine("Could not start trigger"); } } catch (Exception ex) { Console.WriteLine("Could not create new trigger. " + ex.Message); }
Trigger Class | uws.Triggers Namespace | ITrigger