public void TurnOff() { foreach (CircuitSymbol symbol in this.circuitSymbol) { if (symbol.HasCreatedGlyph) { ButtonControl button = this.ProbeView(symbol); button.ButtonStateChanged = null; if (this.isToggle) { FunctionButton.DrawState(button, State.Off); } } } }
public void TurnOn() { foreach (CircuitSymbol symbol in this.circuitSymbol) { if (symbol.HasCreatedGlyph) { ButtonControl button = this.ProbeView(symbol); bool turnedOff = (button.ButtonStateChanged == null); button.ButtonStateChanged = this.StateChangedAction; if (turnedOff && this.isToggle) { FunctionButton.DrawState(button, this.State); } } } }
public void Redraw() { if (this.isToggle) { ButtonControl button = null; if (this.circuitSymbol.Count == 1) { button = (ButtonControl)this.circuitSymbol[0].ProbeView; } else { LogicalCircuit currentCircuit = this.project.LogicalCircuit; CircuitSymbol symbol = this.circuitSymbol.First(s => s.LogicalCircuit == currentCircuit); button = this.ProbeView(symbol); } FunctionButton.DrawState(button, this.State); } }