public void Charger_Contenu(StorageFile eleve) { int i = 0; if (eleve != null && File.Exists(eleve.Name)) { using (StreamReader sr = new StreamReader(eleve.Name)) { string line = sr.ReadLine(); while (line != null) { string[] temp = line.Split(';'); string Nom = temp[0]; string Prénom = temp[1]; ToolTip info_eleve = new ToolTip(); info_eleve.Content = Fonctions_globales.contenu_popup_eleve(temp); Button texte = new Button(); texte.Content = Nom + " " + Prénom; texte.FontSize = 9; texte.VerticalContentAlignment = VerticalAlignment.Top; texte.Name = i.ToString(); texte.Width = 300; texte.Height = 25; texte.HorizontalAlignment = HorizontalAlignment.Left; texte.Click += suppr_Click; ToolTipService.SetToolTip(texte, info_eleve); if (i > 25) { panel_eleve2.Children.Add(texte); } else { panel_eleve1.Children.Add(texte); } i++; line = sr.ReadLine(); } sr.Dispose(); } } Button ajoute = new Button(); ajoute.FontFamily = new FontFamily("Segoe MDL2 Assets"); ajoute.Content = "\uE710"; ajoute.Width = 50; ajoute.Height = 50; ajoute.Click += ajoute_Click; if (i > 25) { panel_eleve2.Children.Add(ajoute); } else { panel_eleve1.Children.Add(ajoute); } }
public void Charger_Contenu(StorageFile groupe) { int i = 0; if (groupe != null && File.Exists(groupe.Name)) { using (StreamReader sr = new StreamReader(groupe.Name)) { string line = sr.ReadLine(); while (line != null) { string[] temp = line.Split(';'); string Option = temp[0]; string Numéro = temp[1]; ToolTip info_groupe = new ToolTip(); info_groupe.Content = Fonctions_globales.contenu_popup_groupe(temp); Button texte = new Button(); texte.Content = "Groupe " + Numéro + " (" + Option + ")"; texte.FontSize = 9; texte.VerticalContentAlignment = VerticalAlignment.Top; texte.Name = i.ToString(); texte.Width = 200; texte.Height = 25; //if (i.ToString() == PublicSettings.groupe_selected) //{ // Brush blue = new SolidColorBrush(Windows.UI.Colors.Blue); // texte.BorderBrush = blue; //} texte.HorizontalAlignment = HorizontalAlignment.Left; texte.Click += selectionne_Click; ToolTipService.SetToolTip(texte, info_groupe); panel_creation.Children.Add(texte); i++; line = sr.ReadLine(); } sr.Dispose(); } Button ajoute = new Button(); ajoute.FontFamily = new FontFamily("Segoe MDL2 Assets"); ajoute.Content = "\uE710"; ajoute.Width = 50; ajoute.Height = 50; ajoute.Click += ajoute_Click; } }
public void Afficher_infos_accueil() { StorageFile colleur = PublicSettings.colleur; if (colleur != null) { if (File.Exists(colleur.Name)) { using (StreamReader sr = new StreamReader(colleur.Name)) { string line = sr.ReadLine(); while (line != null) { string[] temp = line.Split(';'); string Nom = temp[0]; string Matière = temp[1]; string heures = temp[2]; string Salle = temp[3]; TextBlock texte = new TextBlock(); texte.Text = Nom + " " + Matière + " " + heures + " " + Salle; texte.Width = 300; texte.Height = 23; texte.HorizontalAlignment = HorizontalAlignment.Left; stack.Children.Add(texte); line = sr.ReadLine(); } sr.Dispose(); } btnColleurs.Content = colleur.DisplayName; } } StorageFile eleve = PublicSettings.eleve; if (eleve != null) { if (File.Exists(eleve.Name)) { using (StreamReader sr = new StreamReader(eleve.Name)) { string line = sr.ReadLine(); int i = 0; while (line != null) { string[] temp = line.Split(';'); string Nom = temp[0]; string Prénom = temp[1]; TextBlock texte = new TextBlock(); texte.Text = Nom + " " + Prénom; texte.Width = 200; texte.Height = 23; texte.HorizontalAlignment = HorizontalAlignment.Left; ToolTip info_eleve = new ToolTip(); info_eleve.Content = Fonctions_globales.contenu_popup_eleve(temp); ToolTipService.SetToolTip(texte, info_eleve); if (i > 30) { stack_eleves2.Children.Add(texte); } else { stack_eleves1.Children.Add(texte); } line = sr.ReadLine(); i++; } sr.Dispose(); } btnEleves.Content = eleve.DisplayName; btnEleves.IsEnabled = true; } } }