Пример #1
0
        private void ActivateControl()
        {
            if (_controls.ContainsKey(_activeControlType) && _controls[_activeControlType] != null)
            {
                ActiveControl = _controls[_activeControlType];
            }
            else
            {
                ITextureViewControl control = null;
                switch (_activeControlType)
                {
                case ActiveControlTypes.TKMK:
                    control = new TKMKViewControl();
                    break;

                default:
                    control = new TextureViewControl();
                    break;
                }

                pnlTools.Controls.Add(control.GetAsControl());
                _controls.Add(_activeControlType, control);
                ActiveControl = control;
            }

            ActiveControl.ImageUpdated += ImageUpdated;
            ActiveControl.Activate();
        }
Пример #2
0
        private void DeactivateControl()
        {
            if (_controls.ContainsKey(_activeControlType) && _controls[_activeControlType] != null)
            {
                _controls[_activeControlType].Deactivate();
            }

            if (ActiveControl != null)
            {
                ActiveControl.ImageUpdated -= ImageUpdated;
            }

            ActiveControl = null;
        }