Exemplo n.º 1
0
        private void RaiseBulletinUpdated <T>(BulletinNotice <T> notice)
        {
            var bulletingUpdated = this.BulletinUpdated;

            if (bulletingUpdated != null)
            {
                bulletingUpdated(this, notice);
            }
        }
Exemplo n.º 2
0
        public void Remove <T>(BulletinNotice <T> notice)
        {
            if (this.board.ContainsKey(notice))
            {
                this.board.Remove(notice);
            }

            this.RaiseBulletinUpdated(notice);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }