Exemple #1
0
 public static void RemoveBoard(Board Board, ObservableCollection<Board> BoardsCollection)
 {
     if (BoardsCollection != null && Board != null)
     {
         project_flux.API.Board.Archive(Board.ID);
         BoardsCollection.Remove(Board);
     }
 }
Exemple #2
0
 public static void AddBoard(String Name, String Description, ObservableCollection<Board> BoardsCollection)
 {
     Board _newBoard = new Board();
     Task.Run(async () =>
     {
         var teamGuid = Guid.Parse("23c0cca6-cfd8-11e5-950b-93db59257701");
         var createdGuid = Guid.Parse(await project_flux.API.Board.Add(teamGuid, Name));       
         _newBoard.Name = Name;
         _newBoard.Description = Description;
         _newBoard.ID = createdGuid;
         _newBoard.TeamId = teamGuid;
         _newBoard.Jobs = new ObservableCollection<Job>();
     }).Wait();
     BoardsCollection.Add(_newBoard);
 }
Exemple #3
0
 public static void UpdateBoard(Board Board, ObservableCollection<Board> BoardsCollection)
 {
     short _counter = 0;
     try
     {
         foreach (var _board in BoardsCollection)
         {
             if (Board == _board)
             {
                 BoardsCollection[_counter] = Board;
             }
             _counter++;
         }
     } catch { }
     project_flux.API.Board.Update(Board.ID, Board.Name);
 }
 private static async Task<List<Board>> PopulatedBoardsList()
 {
     List<Board> _boards = new List<Board>();
     try {
         var _onlineBoards = await project_flux.API.Board.GetAvailableBoards();    
         foreach (var _onlineBoard in _onlineBoards)
         {
             Board _newBoard = new Board();
             _newBoard.ID = _onlineBoard.Id;
             _newBoard.TeamId = _onlineBoard.TeamId;
             _newBoard.Name = _onlineBoard.Name;
             _newBoard.Jobs = new ObservableCollection<Job>(await PopulatedJobsList(_onlineBoard.Id));
             _boards.Add(_newBoard);
         }
     } catch { }
     return _boards;
 }
        private async void EditBoardPopupShow(Board Board)
        {
            if (Board != null)
            {
                var dialog = new ContentDialog()
                {
                    Title = "Edit board",
                    MaxWidth = this.ActualWidth
                };

                var panel = new StackPanel();

                var txtbxName = new TextBox
                {
                    Name = "txtbxName",
                    Text = Board.Name,
                    Margin = new Thickness(0, 0, 0, 10),
                    PlaceholderText = "Board name"
                };

                panel.Children.Add(txtbxName);
                dialog.Content = panel;

                dialog.PrimaryButtonText = "Save";
                dialog.PrimaryButtonClick += delegate
                {
                    Board.Name = txtbxName.Text;
                    Helpers.BoardsHelper.UpdateBoard(Board,lstbxMenu.ItemsSource as ObservableCollection<Board>);
                };

                dialog.SecondaryButtonText = "Cancel";
                dialog.SecondaryButtonClick += delegate { };

                var result = await dialog.ShowAsync();
            }
        }
        private async void ArchiveBoardPopupShow(Board Board)
        {
            if (Board != null)
            {
                var dialog = new ContentDialog()
                {
                    Title = "Archive Board",
                    Content = "Please confirm archiving \"" + Board.Name + "\"",
                    MaxWidth = this.ActualWidth
                };

                dialog.PrimaryButtonText = "Confirm";
                dialog.PrimaryButtonClick += delegate
                {
                    Helpers.BoardsHelper.RemoveBoard(Board,
                        lstbxMenu.ItemsSource as ObservableCollection<Board>);
                };

                dialog.SecondaryButtonText = "Cancel";
                dialog.SecondaryButtonClick += delegate { };
                var result = await dialog.ShowAsync();
            }
        }