Hello,
How can I retrieve all profile parameters in a protocol QAction?
Thanks in advance
Hi Maximiliano,
Below code can be used for this.
using System.Collections.Generic;
using Skyline.DataMiner.Net.Messages.SLDataGateway;
using Skyline.DataMiner.Net.Profiles;
using Skyline.DataMiner.Scriptingpublic IEnumerable<Skyline.DataMiner.Net.Profiles.Parameter> GetAllProfileParameters(SLProtocol protocol)
{
ProfileHelper profileHelper = new ProfileHelper(protocol.SLNet.SendMessages);return profileHelper.ProfileParameters.Read(new TRUEFilterElement<Skyline.DataMiner.Net.Profiles.Parameter>());
}
FYI: you can use ReadAll() instead of giving TrueFilter:
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Net.ManagerStore.CrudHelperComponentExtension.html
Better example would be:
public IReadOnlyList GetAllProfileParameters(SLProtocol protocol)
{
ProfileHelper profileHelper = new ProfileHelper(protocol.SLNet.SendMessages);
return profileHelper.ProfileParameters.ReadAll();
}
Additional information in DataMiner Docs:
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Net.Profiles.ProfileHelper.html
Please try to use the new ProfileHelper class instead of the obsolete ProfileManagerHelper