コード例 #1
0
        public void Disconnect()
        {
            foreach (var control in this._controls)
            {
                control.Disconnect();
            }

            this.OnDisconnect();
            this._keycosystem = null;
        }
コード例 #2
0
        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();
        }