Table of Contents

Method GetElementReference

Namespace
Skyline.DataMiner.Core.DataMinerSystem.Common
Assembly
Skyline.DataMiner.Core.DataMinerSystem.Common.dll

GetElementReference(DmsElementId)

Initializes a new instance of IDmsElement that acts as a reference to an existing element.

IDmsElement GetElementReference(DmsElementId dmsElementId)

Parameters

dmsElementId DmsElementId

The system-wide element ID.

Returns

IDmsElement

Remarks

This method can be used as an alternative to the GetElement(DmsElementId) or GetElement(string) method. The GetElement(DmsElementId) and GetElement(string) method will in the background perform an SLNet call to request info about the element. Using this method, this additional SLNet call will not always be performed, which can improve performance. However, if you create a Skyline.DataMiner.Core.DataMinerSystem.Common.DmsElement object with an DmsElementId that not exists on the System, an ElementNotFoundException will only be thrown when a call to the server is performed. Using the GetElement(DmsElementId) and GetElement(string) methods will already throw an exception if the element does not exist when the method executes.

    In summary, you can use this method if you are sure the element exists which can result in improved performance because some additional SLNet calls can be avoided.
    If you do not know the element exists, you should use the <xref href="Skyline.DataMiner.Core.DataMinerSystem.Common.IDms.GetElement(Skyline.DataMiner.Core.DataMinerSystem.Common.DmsElementId)" data-throw-if-not-resolved="false"></xref> or <xref href="Skyline.DataMiner.Core.DataMinerSystem.Common.IDms.GetElement(System.String)" data-throw-if-not-resolved="false"></xref> method.
    </p>