Esempio n. 1
0
 // if any of the constraints is violated then this is no op
 public virtual bool AddRow(DataRow row)
 {
     if (checkConstraints(row)) {
         updateConstraints(row);
         this.rows.Add (row);
         return true;
     }
     return false;
 }
 public virtual bool validate(DataRow row)
 {
     return !values.Contains(row[Column]);
 }
 public virtual bool addRow(DataRow row)
 {
     return values.Add (row[Column]);
 }
Esempio n. 4
0
 private void updateConstraints(DataRow row)
 {
     this.constraints.ForEach((x)=>x.addRow(row));
 }
Esempio n. 5
0
 private bool checkConstraints(DataRow row)
 {
     return this.constraints.TrueForAll((x)=>x.validate(row));
 }
Esempio n. 6
0
 public virtual DataRow CreateRow()
 {
     DataRow row = new DataRow() {Table = this};
     return row;
 }
 public bool validate(DataRow row)
 {
     return !rows.Contains(row);
 }
 public bool addRow(DataRow row)
 {
     return rows.Add (row);
 }