i have a requirement where i have to raise attributechangeevent (custom event inherting basemodelchangeevent)for any changes in the attributes.
i have implemented the code using threadpool.queue api but in uaexpert am able to see same data of that event is being raised twice.
when i debug am getting proper info.
How do i synchronize the threadpool?
Code: Select all
foreach (var keyValuePairOfPreRequisiteData in m_DictionaryOfPreRequisiteForProjectData)
{
projectmodel.AttributeChangeEventModel.Affected =
keyValuePairOfPreRequisiteData .key.Nodeid;
projectmodel.AttributeChangeEventModel.AffectedType =
id;
projectmodel.AttributeChangeEventModel.Changes =
attributeChangeStructureTypeCollection.ToArray();
projectmodel.AttributeChangeEventModel.Message = message;
NodeManager.Server.ThreadPool.Queue(
projectmodel.AttributeChangeEventModel,
projectmodel.projectEventHandler.EventHandler);
}