コード例 #1
0
        public TrayStateManager(IContainer components) :
            this()
        {
            if (components == null)
            {
                throw new ArgumentNullException(nameof(components));
            }

            _notifyIcon = new NotifyIconAnimation(components);

            _notifyIcon.Click          += OnTrayIconClick;
            _notifyIcon.BalloonClick   += OnTrayBalloonClick;
            _notifyIcon.BalloonTimeout += OnTrayBalloonTimeoutClose;

            _notifyIcon.AddState(
                new NotifyIconState(ApplicationTrayState.NormalIdle.ToString(),
                                    SR.GUIStatusIdle, Properties.Resources.AppTray)
                );

            _notifyIcon.AddState(
                new NotifyIconState(ApplicationTrayState.BusyRefreshFeeds.ToString(),
                                    SR.GUIStatusBusyRefresh, Properties.Resources.AppBusy)
                );

            _notifyIcon.AddState(
                new NotifyIconState(ApplicationTrayState.NewUnreadFeeds.ToString(),
                                    SR.GUIStatusUnreadFeedItemsAvailable, Properties.Resources.UnreadFeedItems)
                );

            _notifyIcon.Visible = true;
        }
コード例 #2
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_notifyIcon != null)
                {
                    _notifyIcon.Dispose();
                }

                _notifyIcon = null;
            }
        }