private void HandleToggleCounterMessage(ToggleCounter toggle) { if (_isToggledOn) { // toggle is currently on // stop watching this counter _counterCoorActor.Tell(new Unwatch(toggle.CounterType)); } else { // toggle is currently off // start watching this counter _counterCoorActor.Tell(new Watch(toggle.CounterType)); } // flip the toggle _isToggledOn = !_isToggledOn; // change the text of the button toggle.Button.Text = toggle.CounterType.ToString().ToUpperInvariant() + (_isToggledOn ? " (ON)" : " (OFF)"); }
private void HandleCounterToggle(ToggleCounter toggle) { _toggleCoordinatorActor.Tell(toggle); }
private void HandleCounterToggle(ToggleCounter toggle) { _counterToggleActors[toggle.CounterType].Tell(toggle); }