protected void RemoveScheda(Scheda scheda) { _schede.Remove(scheda); foreach (String id in scheda.GetIds()) { String key = GenerateId(scheda.IdScheda, id); if (_values.Keys.Contains(key)) { _values.Remove(key); } } }
protected Boolean ColoraSchedeView(TreeNodeCollection nodes) { Boolean result = false; foreach (TreeNode tn in nodes) { if (tn.Tag is String) { if (ColoraSchedeView(tn.Nodes)) { tn.BackColor = Color.Yellow; result = true; } else { tn.BackColor = Color.Empty; result = false; } } else if (tn.Tag is Scheda) { Scheda s = tn.Tag as Scheda; foreach (String id in s.GetIds()) { if (_values[GenerateId(s.IdScheda, id)][1] != null) { tn.BackColor = Color.Yellow; result = true; } } if (result == false) { tn.BackColor = Color.Empty; } } else if (tn.Nodes.Count > 0) { result = ColoraSchedeView(tn.Nodes); } else { result = false; } } return(result); }
private bool IsSchedaErrata(ElementoTemplate e, Scheda s) { bool result = false; if (e is Contenitore) { foreach (ElementoTemplate figlio in ((Contenitore)e).Children) { if (IsSchedaErrata(figlio, s)) { return(true); } } } else if (e is Contenuto && !s.GetIds().Contains <String>(e.Id)) { return(true); } return(result); }