Пример #1
0
        /// <summary>
        /// Changes the session time.
        /// </summary>
        /// <param name="year">The year.</param>
        /// <param name="month">The month.</param>
        /// <param name="day">The day.</param>
        /// <param name="hour">The hour.</param>
        /// <param name="minute">The minute.</param>
        /// <param name="second">The second.</param>
        public void ChangeSessionTime(short year, short month, short day, short hour, short minute, short second)
        {
            ////this.log.Debug($"SessionTimeProxy ASDASDASD(ChangeSessionTime)");
            ////this.log.Debug($"Year: {year} Month: {month} Day: {day} Hour: {hour} Minute: {minute} Second: {second}");

            var message = new SessionTimeChanged
            {
                NewSessionTime = new DateTime(year, month, day, hour, minute, second)
            };

            var changed = this.ModelUpdaterResolver.GetUpdater <IUpdatableSessionTime, SessionTimeChanged>().Update(this.model, message);

            if (changed)
            {
                this.ServiceClient.PublishAsync(message);
            }
        }
Пример #2
0
 /// <summary>
 /// Handles the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 private void Handle(SessionTimeChanged message)
 {
     this.ModelUpdaterResolver.GetUpdater <IUpdatableSessionTime, SessionTimeChanged>().Update(this.model, message);
 }