I need to make a change in an old collector that is using DMSClass.
DIS indicated that I need to move towards nugets (fix button) and replace the old class lib. (fix button)
However the code was using DMSClass that is now unknown and I don't know what to replace it with to have the code running again.
I've added the Core DataMiner protocol nuget.
Please let me know what to replace the below code with.
DMSClass oDMS = new DMSClass();
Object oReturnValue = new Object();
oDMS.Notify(91/*DMS_GET_ELEMENT_STATE*/, 0, iDataMinerID, iElementID, out oReturnValue);
if (Convert.ToString(oReturnValue) == "active")
{
return true;
}
The element state can be retrieved by the State property on the IDmsElement interface.
To get to this point quickly, below you can find a small snippet:
using Skyline.DataMiner.Core.DataMinerSystem.Common;
using Skyline.DataMiner.Core.DataMinerSystem.Protocol;
IDms dms = protocol.GetDms();
IDmsElement element = dms.GetElement("elementName");
//IDmsElement element = dms.GetElement(new DmsElementId(123, 456));ElementState state = element.State;
if (state == ElementState.Active)
{
return true;
}