G
Guest
Hi guys,
I have three classes like followling:
Class A
{
...
}
Class B
{
...
public A a1 = new A();
}
Class C
{
...
public A a1 = null;
}
class Test
{
void Main()
{
B b1 = new B();
C c1 = new C();
c1.a1 = b1.a1;
this.GetParents(b1.a1);
}
private void GetParents(A a)
{
// ??? how to get b1 and c1 from a?
}
}
My question is: how can I get the instance of b1 and c1 from a1. I mean is
there have any C# basic function to get the instances which hold a1?
I have three classes like followling:
Class A
{
...
}
Class B
{
...
public A a1 = new A();
}
Class C
{
...
public A a1 = null;
}
class Test
{
void Main()
{
B b1 = new B();
C c1 = new C();
c1.a1 = b1.a1;
this.GetParents(b1.a1);
}
private void GetParents(A a)
{
// ??? how to get b1 and c1 from a?
}
}
My question is: how can I get the instance of b1 and c1 from a1. I mean is
there have any C# basic function to get the instances which hold a1?