Пример #1
0
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            LockScreenWidget widget = e.Control as LockScreenWidget;

            if (widget != null)
            {
                widget.LockScreen = null;
            }
            base.OnControlRemoved(e);
        }
Пример #2
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            LockScreenWidget widget = e.Control as LockScreenWidget;

            if (widget == null)
            {
                throw new InvalidOperationException("Only Widgets can be added to this container!");
            }
            widget.LockScreen = this;
            base.OnControlAdded(e);
        }