I have 3 classes:
class A
{
public B b = new B();
public bool flag {get; set;}
}
class B
{
piblic C c = new C();
}
class C
{
public void foo()
{
//iterates a dataTable with column "someBoolCondition"
// I want to set A's bool to true, after the first record that has 'true' in column
//"someBoolCondition". Thus is thought to avoid bool memebers in each class.
}
}
What it the best way set A’s flag to ‘true’ from C’s foo?
TIA
Your C can fire an event every time C changes its own bool. Your A can subscribe to event and update itself. You can also pass an abstracted interface of A to b and C for letting them push the change directly.