Exemple #1
0
 public TimersForm([NotNull] TimersFeature timersFeature, [NotNull] ILogger logger, [NotNull] IWurmApi wurmApi,
                   [NotNull] TimerDefinitions timerDefinitions)
 {
     if (timersFeature == null)
     {
         throw new ArgumentNullException("timersFeature");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (timerDefinitions == null)
     {
         throw new ArgumentNullException("timerDefinitions");
     }
     this.timersFeature    = timersFeature;
     this.logger           = logger;
     this.wurmApi          = wurmApi;
     this.timerDefinitions = timerDefinitions;
     InitializeComponent();
     widgetManager = new WidgetModeManager(this);
     widgetManager.WidgetModeChanging += (sender, args) =>
     {
         buttonAddRemoveChars.Visible
                   = buttonCustomTimers.Visible
                   = buttonOptions.Visible
                   = label1.Visible
                   = !args.WidgetMode;
     };
 }
 public PlayerTimersGroup(string persistentObjectId, TimersFeature timersFeature,
                          [NotNull] IWurmApi wurmApi, [NotNull] ILogger logger, [NotNull] ISoundManager soundManager,
                          [NotNull] ITrayPopups trayPopups, [NotNull] TimerDefinitions timerDefinitions,
                          [NotNull] TimerInstances timerInstances)
     : base(persistentObjectId)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (soundManager == null)
     {
         throw new ArgumentNullException("soundManager");
     }
     if (trayPopups == null)
     {
         throw new ArgumentNullException("trayPopups");
     }
     if (timerDefinitions == null)
     {
         throw new ArgumentNullException("timerDefinitions");
     }
     if (timerInstances == null)
     {
         throw new ArgumentNullException("timerInstances");
     }
     this.Id               = Guid.Parse(persistentObjectId);
     this.timersFeature    = timersFeature;
     this.wurmApi          = wurmApi;
     this.logger           = logger;
     this.timerDefinitions = timerDefinitions;
     this.timerInstances   = timerInstances;
 }
Exemple #3
0
        public EditTimerGroups([NotNull] TimersFeature timersFeature, [NotNull] IWurmApi wurmApi, ILogger logger)
        {
            if (timersFeature == null)
            {
                throw new ArgumentNullException("timersFeature");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.timersFeature = timersFeature;
            this.wurmApi       = wurmApi;
            this.logger        = logger;
            InitializeComponent();

            RebuildGroups();
            playerCb.Items.AddRange(wurmApi.Characters.All.Select(character => character.Name).Cast <object>().ToArray());
            serverGroupCb.Items.AddRange(
                wurmApi.ServerGroups.AllKnown.Select(@group => @group.ServerGroupId).Cast <object>().ToArray());
        }