Hi all I am trying to write and anonymous delegate. as the integer variable is shared among the delegate I need it to be the local instance of every delegate such that rs[0]
always gets nics[0]
, rs[1]
always gets nics[1]
and so on... how will I achieve this.
for (int i = 0; i < nics.Count; i++)
{
rs[i] = new RollingSeries(monitor, new RollingSeries.NextValueDelegate(delegate()
{
return GetNetworkUtilization(nics[i]);
}));
}