Пример #1
0
        private void RaiseBulletinUpdated <T>(BulletinNotice <T> notice)
        {
            var bulletingUpdated = this.BulletinUpdated;

            if (bulletingUpdated != null)
            {
                bulletingUpdated(this, notice);
            }
        }
Пример #2
0
        public void Remove <T>(BulletinNotice <T> notice)
        {
            if (this.board.ContainsKey(notice))
            {
                this.board.Remove(notice);
            }

            this.RaiseBulletinUpdated(notice);
        }
Пример #3
0
        public bool TryRetrieveBulletinMessage <T>(BulletinNotice <T> notice, out T message)
        {
            if (this.board.ContainsKey(notice))
            {
                message = (T)this.board[notice];
                return(true);
            }

            message = default(T);
            return(false);
        }
Пример #4
0
        public void Update <T>(BulletinNotice <T> notice, T message)
        {
            if (!this.board.ContainsKey(notice))
            {
                this.board.Add(notice, message);
            }
            else
            {
                this.board[notice] = message;
            }

            this.RaiseBulletinUpdated(notice);
        }