예제 #1
0
 /// <summary>
 /// Constructeur qui prend une VOTache en paramètre
 /// </summary>
 /// <param name="tache">VOTache</param>
 public TacheViewModel(VOTache tache)
 {
     this.prioriteSelect = new PrioriteViewModel();
     this.Titre = tache.Titre;
     this.Identifiant = tache.Identifiant;
     this.DateLimite = tache.DateLimite;
     this.Estimation = tache.Estimation;
     this.PersonneProjet = new ObservableCollection<PersonneViewModel>();
     this.ListeCategoriesTache = tache.ListeCategoriesTache;
     this.CategoriesProjet = new ObservableCollection<CategorieViewModel>();
     this.ListePersonnesXml = new ObservableCollection<string>();
     this.listePriorite = new ObservableCollection<PrioriteViewModel>();
     this.Constructeur = true;
     this.AjouterPriorite(this.Constructeur, tache);
 }
예제 #2
0
 /// <summary>
 /// Fonction pour ajouter les priorités
 /// </summary>
 /// <param name="constructeurDefault">bool pour savoir le construteur utiliser</param>
 /// <param name="tache">VOTache</param>
 public void AjouterPriorite(bool constructeurDefault, VOTache tache)
 {
     for (int i = 1; i <= 5; i++)
     {
         PrioriteViewModel priorite = new PrioriteViewModel();
         priorite.Texte = i.ToString();
         switch (i)
         {
             case 1:
                 priorite.Couleur = Brushes.Green;
                 break;
             case 2:
                 priorite.Couleur = Brushes.Blue;
                 break;
             case 3:
                 priorite.Couleur = Brushes.Yellow;
                 break;
             case 4:
                 priorite.Couleur = Brushes.Orange;
                 break;
             case 5:
                 priorite.Couleur = Brushes.Red;
                 break;
         }
         listePriorite.Add(priorite);
         if (constructeurDefault == true)
         {
             if (tache.PrioriteDeLaTache == priorite.Texte)
             {
                 this.prioriteSelect = priorite;
             }
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Constructeur par défaut
 /// </summary>
 public TacheViewModel()
 {
     this.PersonneProjet = new ObservableCollection<PersonneViewModel>();
     listeCategoriesTache = new ObservableCollection<string>();
     this.listePriorite = new ObservableCollection<PrioriteViewModel>();
     this.prioriteSelect = new PrioriteViewModel();
     this.Constructeur = false;
     this.AjouterPriorite(this.Constructeur, null);
 }