public bool Metajour(TreeNode tn) { MiseAJourObjet mf = new MiseAJourObjet(this, tn); if (mf.ShowDialog() == DialogResult.OK) { if (this is Marqueurs marqueur) { string[] s = marqueur.Date.Split(':'); int h = int.Parse(s[0]); int mn = int.Parse(s[1]); int sec = int.Parse(s[2]); TimeSpan ticks = new TimeSpan(h, mn, sec); marqueur.Adresse = ticks.Ticks; } //else if (this is Musicien musicien) // if(musicien.Photo != null) //{ // Image im = Image.FromStream(new MemoryStream(musicien.Photo)); // MainForm.imagesMusiciens.Images.Add(musicien.Code_Musicien.ToString(), im); // tn.ImageKey = musicien.Code_Musicien.ToString(); // tn.SelectedImageKey = tn.ImageKey; // im.Dispose(); //} return(true); } return(false); }
public bool Metajour() { MiseAJourObjet mf = new MiseAJourObjet(this); if (mf.ShowDialog() == DialogResult.OK) { return(true); } return(false); }
private void Position1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { if (TimeSpan.TryParse(position1.Text, out TimeSpan r)) { Marqueurs marqueur = new Marqueurs { Disques = disqueCourant, Adresse = r.Ticks, Date = r.ToString() }; MiseAJourObjet ms = new MiseAJourObjet(marqueur /*, md*/, disqueCourant.Trouve(arbreFichiers.Nodes)); if (ms.ShowDialog() == DialogResult.OK) { disqueCourant.AjoutMarqueur(marqueur, arbreFichiers); } } } }
private MiseAJourObjet MetaJour(PropertyInfo pi, Object objet, TreeNode tn = null) { MiseAJourObjet mf = new MiseAJourObjet(objet, tn); if (mf.ShowDialog() == DialogResult.OK) { foreach (Control s in Controls) { if (s.Name == pi.Name) { if (s is ComboBox box) { box.Items.Add(objet); box.SelectedItem = objet; } } } } return(mf); }