/// <summary> /// adds a new Timer descriptor, which is used to generate list for users to choose from /// </summary> /// <param name="name">short descriptive name for this timer</param> /// <param name="type">typeof(MyTimerClass)</param> /// <param name="options">configuration options for CustomTimer</param> /// <param name="customTimer">set true to persist custom timer between sessions</param> static void AddDescriptor(string name, Type type, CustomTimerOptions options = null, bool customTimer = false) { foreach (var group in ServerInfo.GetAllServerGroups()) { TimerType timertype = new TimerType(name, group, type, options); Descriptors.Add(timertype); if (customTimer) PersistentDescriptors.Value.Add(timertype); } if (customTimer) PersistentDescriptors.Save(); }
public static void AddCustomTimer(string nameID, CustomTimerOptions options) { AddDescriptor(nameID, typeof(CustomTimer), options, true); }
public TimerType(string name, ServerInfo.ServerGroup group, Type underlyingType, CustomTimerOptions options) { NameID = name; Group = group; UnderlyingTimerType = underlyingType; Options = options; }