Пример #1
0
        private async void ChangeObjectSlotSize(int size)
        {
            _resizeObjSlotTime = 500;
            if (_objSlotResizing)
            {
                return;
            }

            _objSlotResizing = true;

            await Task.Run(() =>
            {
                while (_resizeObjSlotTime > 0)
                {
                    Task.Delay(100).Wait();
                    _resizeObjSlotTime -= 100;
                }
            });

            WatchVariablePanelObjects.Visible = false;
            ObjectSlotsManager.ChangeSlotSize(size);
            WatchVariablePanelObjects.Visible = true;
            _objSlotResizing = false;
        }
Пример #2
0
        private async void trackBarObjSlotSize_ValueChanged(object sender, EventArgs e)
        {
            _resizeObjSlotTime = 500;
            if (_objSlotResizing)
            {
                return;
            }

            _objSlotResizing = true;

            await Task.Run(() =>
            {
                while (_resizeObjSlotTime > 0)
                {
                    Task.Delay(100).Wait();
                    _resizeObjSlotTime -= 100;
                }
            });

            NoTearFlowLayoutPanelObjects.Visible = false;
            _objectSlotManager.ChangeSlotSize(trackBarObjSlotSize.Value);
            NoTearFlowLayoutPanelObjects.Visible = true;
            _objSlotResizing = false;
        }