I do not get the following. I always thought that I could only access private fields from the class in which the field was declared. However, in this case, I can access it:
class Session
{
List<client> ListOfClients = new List<client>();
public void IterateClients(Action<client> action)
{
}
}
class client
{
private int A;
Session area;
public void SendData()
{
area.IterateClients(delegate(client c)
{
c.A = 5;
});
}
}
source
share