}//ToDetails


                /// <summary>
                /// Displays the Details panel, is used for advanced tasks
                /// </summary>
                /// <param name="dp"></param>
                internal void ToDetails(string name, string details, SingleTaskPanel taskPanel, string priority, string state)
                {
                        //Removing the options panel so that the right panel can become the details panel
                        _contentPanel.Children.Remove(_contentPanel._optionsPanel);

                        DetailsPanel dp = new DetailsPanel(name, details, taskPanel,this, priority, state);
                        //If the details panel has not been instantiated
                        if(_contentPanel._detailsPanel == null)
                        {
                                //We create a new details panel and add it to the content panel
                                
                                _contentPanel._detailsPanel = dp;
                                _contentPanel.Children.Add(_contentPanel._detailsPanel);  
                        }

                        else
                        {
                                _contentPanel.Children.Remove(_contentPanel._detailsPanel);
                                _contentPanel._detailsPanel = dp;
                                _contentPanel.Children.Add(_contentPanel._detailsPanel);  
                        }
                    
                        //We are on the details panel, we are no longer on the options panel
                        _contentPanel._isOnOptions = false;
                }//ToDetails
                /// <summary>
                /// Is used for brainstormings
                /// </summary>
                /// <param name="name"></param>
                /// <param name="details"></param>
                /// <param name="taskPanel"></param>
                /// <param name="coordinator"></param>
                public DetailsPanel(string name, string details, SingleTaskPanel taskPanel, RightPanelCoordinator coordinator)
                {
                        //Setting up the details panel properties
                        this.Orientation = Orientation.Vertical;
                        this.Width = Dimensions.GetWidth() * 0.27;
                        this.Height = Dimensions.GetHeight() * 0.8;
                        this.Background = ThemeSelector.GetBackground();
                        _container = new StackPanel();
                        _container.Orientation = System.Windows.Controls.Orientation.Vertical;

                        //Setting up the fields
                        _coordinator = coordinator;
                        _name = new TextBlock();
                        _details = new TextBlock();                       

                        _name.Text = name;
                        _details.Text = details;
                        _taskPanel = taskPanel;

                        _updateButton = new ValidateButton(ControlsValues.UPDATE, this.Width * 0.6, this.Height * 0.05, new System.Windows.Thickness(0, 0, 0, 0), new System.Windows.Thickness(0, 0, 0, 0), System.Windows.HorizontalAlignment.Center);
                        _updateButton.MouseDown += _updateButton_MouseDown;

                        _deleteButton = new CancelButton(ControlsValues.DELETE, this.Width * 0.6, this.Height * 0.05, new System.Windows.Thickness(0, 20, 0, 0), new System.Windows.Thickness(0, 0, 0, 0), System.Windows.HorizontalAlignment.Center);

                        _deleteButton.MouseDown += _deleteButton_MouseDown;

                        _quitButton = new CancelButton(ControlsValues.CLOSE, this.Width * 0.6, this.Height * 0.05, new System.Windows.Thickness(0, 30, 0, 0), new System.Windows.Thickness(0, 0, 0, 0), System.Windows.HorizontalAlignment.Center);
                        _quitButton.MouseDown += _quitButton_MouseDown;

                        //Setting up the components
                        SetUpName();
                        _nameSeparator = SetUpSeparator();                        
                        SetUpDetails();
                        

                        //Adding the components to the details panel
                        _container.Children.Add(_name);
                        _container.Children.Add(_nameSeparator);
                        _container.Children.Add(_details);
                        _container.Children.Add(_updateButton);
                        _container.Children.Add(_deleteButton);
                        _container.Children.Add(_quitButton);

                        this.Children.Add(_container);
                }
Esempio n. 3
0
                public void FillBrainstormings(OptionsPanel optionsPanel)
                {
                        optionsPanel.HideButtons();
                        this.Children.Clear();
                        
                        List<Model.Task> brains = _chief.SelectBrainstormings();

                        if(brains.Count != 0 )
                        {
                                foreach (Model.Task item in brains)
                                {
                                        SingleTaskPanel brainStorming = new SingleTaskPanel(item);
                                        _brainstormingList.Add(brainStorming);
                                        brainStorming.MouseDown += brainStorming_MouseDown;
                                        this.Children.Add(brainStorming);
                                }
                        }
                        else
                        {
                                this.Children.Add(new EmptyTaskPanel(ControlsValues.BRAINSTORMING));
                        }
                       
                }//FillBrainstormings
                }//SetUpDetailsContent()

                private void SetUpDetailsContent(string name, string details, SingleTaskPanel taskPanel, string priority)
                {
                        _contentPanel._detailsPanel._name.Text = name;
                        _contentPanel._detailsPanel._details.Text = details;
                        _contentPanel._detailsPanel._taskPanel = taskPanel;
                        _contentPanel._detailsPanel.SetPriorityLayout(priority);
                }//SetUpDetailsContent()
                }//ToDetails

                private void SetUpDetailsContent(string name, string details, SingleTaskPanel taskPanel)
                {
                        _contentPanel._detailsPanel._name.Text = name;
                        _contentPanel._detailsPanel._details.Text = details;
                        _contentPanel._detailsPanel._taskPanel = taskPanel;
                }//SetUpDetailsContent()