示例#1
0
 public virtual void OnTurnedOn(TurnedOnEventArgs e)
 {
     _tvState.IsOn    = true;
     _tvState.Version = e.Version;
     dataContext.Update(_tvState, x => x.IsOn, x => x.Version);
     dataContext.Commit();
     Console.WriteLine("TurnedOnEventArgs");
 }
示例#2
0
        /// <summary>Turns the television on.</summary>
        /// <exception cref="InvalidOperationException">The television is currently on.</exception>
        public void TurnOn()
        {
            if (IsOn)
            {
                throw new InvalidOperationException("The television is currently on and cannot be turned on again.");
            }
            TurnedOnEventArgs e = new TurnedOnEventArgs();

            EntityState.Apply(e);
        }
示例#3
0
 protected virtual void OnTurnedOn(TurnedOnEventArgs e)
 {
     IsOn = true;
 }