Exemplo n.º 1
0
        public NiNotificationManager(CorePackage package)
            : base(package)
        {
            _package = package;

            _button = new NiTitleBarButton
            {
                Priority  = 100,
                Image     = Resources.NotificationsInactive,
                ForeColor = SystemColors.ControlDark
            };

            _titleBarButtonManager = ((INiTitleBarButtonManager)GetService(typeof(INiTitleBarButtonManager)));

            ErrorUtil.ThrowOnFailure(_titleBarButtonManager.AddButton(_button, out _buttonCookie));

            _buttonListener = new ButtonListener(this);
        }
Exemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed && disposing)
            {
                if (_button != null)
                {
                    _titleBarButtonManager.RemoveButton(_buttonCookie);
                    _buttonCookie = 0;
                    _button       = null;
                }

                if (_buttonListener != null)
                {
                    _buttonListener.Dispose();
                    _buttonListener = null;
                }

                _disposed = true;
            }

            base.Dispose(disposing);
        }