public virtual void OnTurnedOff(TurnedOffEventArgs e)
 {
     _tvState.IsOn    = false;
     _tvState.Version = e.Version;
     dataContext.Update(_tvState, x => x.IsOn, x => x.Version);
     dataContext.Commit();
     Console.WriteLine("TurnedOffEventArgs");
 }
Exemple #2
0
        /// <summary>Turns the television off.</summary>
        /// <exception cref="InvalidOperationException">The television is not powerd on.</exception>
        public void TurnOff()
        {
            if (!IsOn)
            {
                throw new InvalidOperationException("The television is not on and cannot be turned off.");
            }
            TurnedOffEventArgs e = new TurnedOffEventArgs();

            EntityState.Apply(e);
        }
Exemple #3
0
 protected virtual void OnTurnedOff(TurnedOffEventArgs e)
 {
     IsOn = false;
 }