Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Kanban workshop
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • Support
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Skyline.DataMiner.CommunityLibrary.Utility.Protocol

Solved315 views14th May 2025protocol
2
Ryan Hepworth [DevOps Advocate]990 25th February 2025 0 Comments

Hi All

Does anyone know if this is an internal Skyline nuget package?

Skyline.DataMiner.CommunityLibrary.Utility.Protocol

Regards

Ryan

Ryan Hepworth [DevOps Advocate] Selected answer as best 14th May 2025

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Michiel Oda [SLC] [DevOps Enabler]3.61K Posted 26th February 2025 4 Comments

Hi Ryan

Yes, the Skyline.DataMiner.CommunityLibrary.Utility.Protocol is an internal NuGet package. Depending on what you need from it, some parts (like the GetColumns) is already part of the Skyline.DataMiner.Core.DataMinerSystem.Protocol NuGet package (protocol.GetLocalElement().GetTable().GetColumns).

Ryan Hepworth [DevOps Advocate] Selected answer as best 14th May 2025
Ryan Hepworth [DevOps Advocate] commented 26th February 2025

Hi Michiel,

Thanks for that, I am wanting to use the ClearTables and GetColumnAsDictionary method.

Its a protocol from SkyLine that I am trying to slightly modify to test something out and in VS those are the only errors I am getting relating to that nuget package

Michiel Oda [SLC] [DevOps Enabler] commented 28th February 2025

Hi Ryan
That library isn't maintained anymore. I had a look and the ClearTables method is just doing a protocol.DeleteRows with the primaryKeys (via GetColumn). The GetColumnsAsDictionary is a regular GetColumns which is looped over and put in a dictionary. You could easily recreate these methods in your precompile QAction and remove the reference to UtilityLibrary (as that will be kept internal).

Ryan Hepworth [DevOps Advocate] commented 28th February 2025

Hi Michiel,

Ok thanks for this, when you say DeletRows, is that with an s or just protocol.DeleteRow?

Do you have these methods you could share?

Michiel Oda [SLC] [DevOps Enabler] commented 6th March 2025

Hi Ryan
I meant the protocol.DeleteRow. Instead of the 'raw' calls, I'll do you one better. Recently a new NuGet was made that contains some extension methods which are a clearer than the old NotifyProtocol calls.
You need to install the Skyline.DataMiner.Utils.Protocol.Extensions NuGet in your QAction. Then add the using 'using Skyline.DataMiner.Utils.Protocol.Extensions' at the top. Then in your code you can add these methods:

public static void ClearTable(SLProtocol protocol, int tablePid)
{
object[] keys = protocol.GetColumn(tablePid, 0);

protocol.DeleteRows(tablePid, keys);
}

public static IDictionary<string, object> GetColumnAsDictionary<T>(SLProtocol protocol, int tablePid, uint columnIdx)
where T : IConvertible
{
IDictionary<string, object> result = new Dictionary<string, object>();
object[] columns = protocol.GetColumns(tablePid, new uint[] { 0, columnIdx });
object[] keys = (object[])columns[0];
object[] values = (object[])columns[1];

for (int i = 0; i < keys.Length; i++)
{
result.Add(Convert.ToString(keys[i]), values[i].ChangeType<T>());
}

return result;
}

private static T ChangeType<T>(this object obj)
where T : IConvertible
{
if (obj == null)
{
return default(T);
}

var type = typeof(T);

if (type.IsEnum)
{
return (T)Enum.ToObject(type, obj.ChangeType<int>());
}

if (type != typeof(DateTime))
{
return (T)Convert.ChangeType(obj, type);
}

var oadate = Convert.ToDouble(obj);

if (oadate.CompareTo(-657435.0) >= 0 && oadate.CompareTo(2958465.99999999) <= 0)
{
object date = DateTime.FromOADate(oadate);

return (T)date;
}

throw new OverflowException($"{obj} is not a valid OA Date, supported range -657435.0 to 2958465.99999999");
}

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs