Esempio n. 1
0
            private void DoTimerCallback(object state)
            {
                var now     = DateTime.Now;
                var context = new UpdateContext(now - started);

                foreach (var beehive in Beehives)
                {
                    beehive.Update(context);
                }

                updated.Invoke(this, new SessionUpdatedEventArgs(context.Elapsed));
            }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="options"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public Task SaveOptionsAsync(ApplicationOptions options, CancellationToken token)
        {
            if (null == options)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (null == token)
            {
                throw new ArgumentNullException(nameof(token));
            }

            cache.Set(options);

            optionsChanged.Invoke(this, new OptionsChangedEventArgs(options));

            return(Task.CompletedTask);
        }
Esempio n. 3
0
 public void AddBee(IBee bee)
 {
     bees.Add(bee);
     changed.Invoke(this, new BeehiveChangedEventArgs(BeehiveAcion.BeeAdded, bee));
 }
Esempio n. 4
0
 public void RunAction(DispatchedAction action, object payload)
 {
     executeAction.Invoke(this, new DispatcherActionExecuteEventArgs(action, payload));
 }