protected virtual void DisplayContenuto(Scheda scheda, TableLayoutPanel table, Contenuto con, int level) { if (_schedaCorrente == null) { return; } String tabs = ""; for (int i = 0; i < level; i++) { tabs += " "; } String key = con.Id; Label l = new Label(); l.AutoSize = true; l.Text = tabs + key; table.Controls.Add(l); Label l2 = new Label(); l2.AutoSize = true; l2.Text = scheda.GetValore(key); table.Controls.Add(l2); TextBox tb = new TextBox(); tb.Text = scheda.GetValore(key); table.Controls.Add(tb); String[] ProprietaTag = new String[] { scheda.IdScheda, con.Id, scheda.GetValore(con.Id), null }; //ID scheda | ID campo | Valore vecchio | Valore nuovo Button conferma = new Button(); conferma.Text = "Conferma"; conferma.Tag = ProprietaTag; conferma.Click += ModificaCampoScheda; table.Controls.Add(conferma); Button cancella = new Button(); cancella.Text = "Cancella"; cancella.Tag = con; cancella.Click += RipristinaCampoScheda; table.Controls.Add(cancella); }
private String Replace(ElementoTemplate e, String expression) { if (e is Contenitore) { foreach (ElementoTemplate figlio in ((Contenitore)e).Children) { expression = Replace(figlio, expression); } } else { String nomecontenuto = ((Contenuto)e).Id; String valore = _schedaCorrente.GetValore(nomecontenuto); expression = expression.Replace(nomecontenuto, valore); } return(expression); }