public void Disconnect() { foreach (var control in this._controls) { control.Disconnect(); } this.OnDisconnect(); this._keycosystem = null; }
public void Connect(Keycosystem keycosystem) { if (this._keycosystem != null) { throw new InvalidOperationException($"This control of type {this.GetType().Name} is already connected to a {nameof(Keycosystem)}!"); } foreach (var control in this._controls) { control.Connect(keycosystem); } this._keycosystem = keycosystem; this.OnConnect(); }