P
Peter Schall
Hello,
I try to loop through all child relations and call a specific method I pass
as a parameter. But how is it done correctly, so that the passed method is
called by the relation child. Or any better solution is wellcome.
Thanks Peter
class SQLCursor: Datatable
{
protected delegate bool ChildUpdateHandler();
void UpdateDeleted
{
this.IterateChildRelations(new ChildUpdateHandler(this.UpdateDeleted));
}
void UpdateModified
{
this.IterateChildRelations(new ChildUpdateHandler(this.UpdateModified));
}
bool IterateChildRelations(ChildUpdateHandler doMethod)
{
foreach(DataRelation rel in this.ChildRelations)
{
//doMethod() // just calls itself, but not the rel.Table
//rel.doMethod() // unknown
}
}
}
I try to loop through all child relations and call a specific method I pass
as a parameter. But how is it done correctly, so that the passed method is
called by the relation child. Or any better solution is wellcome.
Thanks Peter
class SQLCursor: Datatable
{
protected delegate bool ChildUpdateHandler();
void UpdateDeleted
{
this.IterateChildRelations(new ChildUpdateHandler(this.UpdateDeleted));
}
void UpdateModified
{
this.IterateChildRelations(new ChildUpdateHandler(this.UpdateModified));
}
bool IterateChildRelations(ChildUpdateHandler doMethod)
{
foreach(DataRelation rel in this.ChildRelations)
{
//doMethod() // just calls itself, but not the rel.Table
//rel.doMethod() // unknown
}
}
}