public void HandleUserNotification(ObservableCollection <ShortBoard> boardList, ShortBoard selectedBoard, ObservableCollection <Notification> notifications, IMQMessage message)
        {
            ShortBoard deleteBoard = boardList.SingleOrDefault(el => el.BoardId == ((DeleteMessage)message).Data);

            boardList.Remove(deleteBoard);
            if (selectedBoard != null && selectedBoard.BoardId == deleteBoard.BoardId)
            {
                selectedBoard = null;
            }
        }
Exemplo n.º 2
0
        public void OnBoardSelected(ShortBoard board)
        {
            if (board != null)
            {
                BoardViewModel vm = CenterViewModel as BoardViewModel;
                vm?.UnsubscribeFromBoard();

                CenterViewModel = new BoardViewModel(board, OnBoardDeleted);
            }
        }
Exemplo n.º 3
0
        private void UpdateBoardAction(object obj)
        {
            BasicBoardDTO newBoard = (BasicBoardDTO)obj;

            if (obj != null)
            {
                ShortBoard old = Boards.FirstOrDefault(b => b.BoardId == newBoard.BoardId);

                if (old != null)
                {
                    ShortBoard.UpdateBoard(old, newBoard);
                }
            }
        }
Exemplo n.º 4
0
        private void DeletePermissionUserAction(object obj)
        {
            int id = (int)obj;

            ShortBoard deleteBoard = Boards.SingleOrDefault(el => el.BoardId == id);

            if (deleteBoard != null)
            {
                Boards.Remove(deleteBoard);

                if (selectedBoard != null && selectedBoard.BoardId == deleteBoard.BoardId)
                {
                    selectedBoard = null;
                }
            }
        }
Exemplo n.º 5
0
        public BoardViewModel(ShortBoard shortBoard, Action <int> boardDeleted)
        {
            //Partial data
            ShortBoard = shortBoard;

            //View models
            UsersViewModel    = new EmptyViewModel();
            CardListViewModel = new EmptyViewModel();
            RightViewModel    = new EmptyViewModel();

            //Actions
            BoardDeleted = boardDeleted;

            //Commands
            DeleteBoardCommand        = new CommandBase(OnDeleteBoardClick);
            DeleteBoardCommandVisible = false;
            RenameBoardCommand        = new CommandBase(OnRenameBoardClick);

            //Load data
            LoadBoard();
            InitActions();
            Subscribe();
        }
 public void HandleUserNotification(ObservableCollection <ShortBoard> boardList, ShortBoard selectedBoard, ObservableCollection <Notification> notifications, IMQMessage message)
 {
     notifications.Add(new Notification(((NotificationMessage)message).Data));
 }
        public void HandleUserNotification(ObservableCollection <ShortBoard> boardList, ShortBoard selectedBoard, ObservableCollection <Notification> notifications, IMQMessage message)
        {
            int targetBoardId = ((BoardNotificationMessage)message).Data;

            if (selectedBoard == null || targetBoardId != selectedBoard.BoardId)
            {
                boardList.SingleOrDefault(el => el.BoardId == targetBoardId).IsRead = false;
            }
            else if (selectedBoard != null && targetBoardId == selectedBoard.BoardId)
            {
                //BoardNotificationService.ReadBoardNotification(ActiveUser.Instance.LoggedUser.Token, targetBoardId);
            }
        }