コード例 #1
0
ファイル: WurmTimer.cs プロジェクト: webba/WurmAssistant2
 /// <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();
 }
コード例 #2
0
ファイル: WurmTimer.cs プロジェクト: webba/WurmAssistant2
 public static void AddCustomTimer(string nameID, CustomTimerOptions options)
 {
     AddDescriptor(nameID, typeof(CustomTimer), options, true);
 }
コード例 #3
0
ファイル: WurmTimer.cs プロジェクト: webba/WurmAssistant2
 public TimerType(string name, ServerInfo.ServerGroup group, Type underlyingType, CustomTimerOptions options)
 {
     NameID = name;
     Group = group;
     UnderlyingTimerType = underlyingType;
     Options = options;
 }