Exemplo n.º 1
0
        public Form2(Calendrier calendrier,Journee jour)
        {
            InitializeComponent();
            jourActuel = jour;
            calendrierActuel = calendrier;
            this.tagJourActuel.Text = jour.NumJour.ToString();
            this.tagJourActuel2.Text = jour.NumJour.ToString();
            _taille10minPixel = 5; // 10 minutes = 5 pixel
            this.richTextBox2.Text = jourActuel.CompteRendu;

            afficheBoutons();
        }
Exemplo n.º 2
0
 public Form3(Calendrier calendrier, Journee jourActuel, Activite actiActuelle)
 {
     InitializeComponent();
     this.labelJ.Text = jourActuel.ToString();
     this.labelActi.Text = actiActuelle.TexteDescritpif.ToString();
 }
Exemplo n.º 3
0
        private void rafraichirPage(int jour)
        {
            jourActuel = calendrierActuel.ListJournees.ElementAt(jour);

            miseAJourJour(jourActuel.NumJour);
            richTextBox2.Text = jourActuel.CompteRendu;
            afficheBoutons();
        }
Exemplo n.º 4
0
        public Form1()
        {
            InitializeComponent();

            Cal = new Calendrier();

            for (int i = 0; i < 500; i++)
            {
                Journee jour = new Journee(i,Cal.ListSpationaute);
                jour.CompteRendu = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque dolore magnam aliquam quaerat voluptatem. Ut enim quo voluptas nulla pariatur?";
            }

            if (this.ListBtnJour == null)
            {
                ListBtnJour = new List<Button>();
            }

            for (int i = 1; i <= 50; i++)
            {
                Button btn_jour = new Button();
                ListBtnJour.Add(btn_jour);

                btn_jour.Size = new Size(50, 50);

                // Pour le chargement de la 1ère page du calendrier : on sait que le numéro du jour va de 1 à 50
                btn_jour.Text = btn_jour.Name = i.ToString();
                btn_jour.Location = new Point(60 + (posX * 50), 60 + (posY * 50));
                posX++;

                //mise à jour des positions, si x depasse le nombre max d'elements en horizontal, on passe à la ligne suivante
                if (posX >= 10)
                {
                    posX = 0;
                    posY++;
                }

                this.Controls.Add(btn_jour);
                btn_jour.Click += jour_Click;//fonction de click sur le Btn_jour

                //gestion de la couleur
                if (int.Parse(btn_jour.Name) < jourActuel)
                    btn_jour.BackColor = Color.LightGray;
                else if (int.Parse(btn_jour.Name) == jourActuel)
                    btn_jour.BackColor = Color.LightBlue;
                else
                    btn_jour.BackColor = Color.LightGreen;

            }

            #region Activités par défauts

            // On ajoute toutes les activités par défaut
            int index = 0;
            foreach (var item in Cal.ListJournees)
            {
                Activite Sleeping1 = new Activite("Sleeping" ,new Dates(item.NumJour, 0, 0), new Dates(item.NumJour, 7, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"),"",Cal.ListSpationaute);
                Activite Sleeping2 = new Activite("Sleeping", new Dates(item.NumJour, 23, 0), new Dates(item.NumJour, 24, 40), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"), "", Cal.ListSpationaute);
                Activite Eating1 = new Activite("Eating", new Dates(item.NumJour, 7, 0), new Dates(item.NumJour, 8, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"), "", Cal.ListSpationaute);
                Activite Eating2 = new Activite("Eating", new Dates(item.NumJour, 12, 0), new Dates(item.NumJour, 14, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"), "", Cal.ListSpationaute);
                Activite Eating3 = new Activite("Eating", new Dates(item.NumJour, 19, 0), new Dates(item.NumJour, 21, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/"COUCOU"), "", Cal.ListSpationaute);
                Activite Private1 = new Activite("Eating", new Dates(item.NumJour, 8, 0), new Dates(item.NumJour, 12, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"), "", Cal.ListSpationaute);
                Activite Private2 = new Activite("Private", new Dates(item.NumJour, 14, 0), new Dates(item.NumJour, 19, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"),"", Cal.ListSpationaute);
                Activite Private3 = new Activite("Private", new Dates(item.NumJour, 21, 0), new Dates(item.NumJour, 23, 0), new Coordonnees(new Point(), /* pictureBox1.Image,*/ "COUCOU"), "", Cal.ListSpationaute);

                item.ListActiviteJournee.Add(Sleeping1);

                if (index % 1 == 0)
                    item.ListActiviteJournee.Add(Sleeping2);
                if (index % 2 == 0)
                    item.ListActiviteJournee.Add(Eating1);
                if (index % 6 == 0)
                    item.ListActiviteJournee.Add(Eating2);
                if (index % 3 == 0)
                    item.ListActiviteJournee.Add(Eating3);
                if (index % 8 == 0)
                    item.ListActiviteJournee.Add(Private1);
                if (index % 6 == 0)
                    item.ListActiviteJournee.Add(Private2);
                if (index % 4 == 0)
                    item.ListActiviteJournee.Add(Private3);
                item.ListActiviteJournee.Sort(
                    delegate(Activite a1, Activite a2) // Et on les ordonne
                    {
                        int HA1 = a1.HeureDebut.heure * 60 + a1.HeureDebut.minute;
                        int HA2 = a2.HeureDebut.heure * 60 + a2.HeureDebut.minute;
                        return HA1.CompareTo(HA2);
                    });

                index++;
            }

            #endregion
        }