public override void On() // включили холодильник { if (Status == false) { Status = true; if (TurnedOn != null) { TurnedOn.Invoke("Холодильник включили"); } } }
public IEnumerator TempButton() { m_Activated = true; m_AlreadyInteracting = true; TurnedOn.Invoke(); yield return(new WaitForSeconds(m_TempButtonDuration)); m_Activated = false; m_AlreadyInteracting = false; TurnedOff.Invoke(); }
public void Should_Set_Percentage_To_100_When_Turning_On_Device_Without_Setting_Percentage() { TurnOnCommand cmd = new TurnOnCommand(Guid.NewGuid()); var p = Domain.Device.TurnOn(eventMetadata, moqEventStore.Object, cmd); var events = p.GetUncommittedEvents(); Assert.IsNotEmpty(events); Assert.AreEqual(1, events.Count()); Assert.IsInstanceOf <TurnedOn>(events.First()); TurnedOn turnedOn = events.First() as TurnedOn; turnedOn.Level.ShouldEqual(100); }
private IEnumerator OnWhileOn() { m_Activated = true; m_AlreadyInteracting = true; TurnedOn.Invoke(); yield return(null); yield return(null); Debug.Log("Off"); m_Activated = false; m_AlreadyInteracting = false; TurnedOff.Invoke(); m_OnWhileTriggered = null; }
public IEnumerator ActivationCooldown() { m_Activated = !m_Activated; m_AlreadyInteracting = true; if (m_Activated) { TurnedOn.Invoke(); } else { TurnedOff.Invoke(); } yield return(new WaitForSeconds(m_DelayBetweenActivations)); m_AlreadyInteracting = false; }
public virtual void TurnOn() { TurnedOn?.Invoke(this, EventArgs.Empty); IsOn = true; }
protected virtual void OnButtonOn() => TurnedOn?.Invoke(this, EventArgs.Empty);
private void Apply(TurnedOn e) { AggregateGuid = e.AggregateGuid; Level = e.Level; }