Monday, January 26, 2015

Populate and clear list in a task

Hello,


Effectivly, that's no the good way.


You should use it like this :



private static object obj_lock = new object();

public static void FillCollection(DynamicCollection<T> dc)
{
lock (obj_lock)
{
dc.Clear();
// Populate the list in a loop ...
}
}

Regards,




Kevin BEAUGRAND, Modis FRANCE
Merci de bien vouloir "Marquer comme réponse", les réponses qui ont résolu votre problème.


No comments:

Post a Comment