Changing Map Icon according to sensor status

I am developing a Sensor Monitor plugin. I need to change the icon of a sensor according to the status of the Sensor. I tried

CurrentItem.MapIconKey = SensorMonitorSensorActivated;

But it is not working. The value of MapIconKey not changing to SensorMonitorSensorActivated.

How can I set a sensor status to Active?

SensorItem.SensorActiveState[sen.FQID.ObjectId] = true;

I used this code, but not working

Please see SensorItem.cs and override MapIconKey (line 59). It might be helpful.