/// <summary> /// Vypne/zapne ovládání pomocí ovladače /// </summary> /// <param name="on">true pokud zapnout</param> public void onOff(bool on) { if (buttonAbsolutPositioning.InvokeRequired && buttonDefaultPosition.InvokeRequired && buttonMoveDown.InvokeRequired && buttonMoveUp.InvokeRequired && buttonNarrow.InvokeRequired && buttonWiden.InvokeRequired) { OnOffCallback cb = new OnOffCallback(onOff); this.Invoke(cb, new object[] { on }); } else { buttonAbsolutPositioning.Enabled = on; buttonDefaultPosition.Enabled = on; buttonMoveDown.Enabled = on; buttonMoveUp.Enabled = on; buttonNarrow.Enabled = on; buttonWiden.Enabled = on; buttonRotateLeft.Enabled = on; buttonRotateRight.Enabled = on; buttonStop.Enabled = on; buttonTiltBack.Enabled = on; buttonTiltFront.Enabled = on; buttonTiltLeft.Enabled = on; buttonTiltRight.Enabled = on; trackBarsNarrowEnabled = on; enabledStick = on; } }