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
    • 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
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Script Does not contain GetDms

Solved599 views26th October 2024
1
Davor Joleski [DevOps Enabler]572 26th October 2024 0 Comments

HI guys this getdms var cant read it it saying
Severity Code Description Project File Line Suppression State Details

public class MaskElementDialog : Dialog
{
private readonly Label helloPapi;
private readonly Label elemPapi;
public MaskElementDialog(IEngine engine) : base(engine)
{
helloPapi = new Label($"Hi {engine.UserDisplayName} please select an elment to mask");
elemPapi = new Label("Eelemtn");
var getdms = engine.GetDms();
EelemntDropdown = new DropDown();
}

Error (active) CS1061 'IEngine' does not contain a definition for 'GetDms' and no accessible extension method 'GetDms' accepting a first argument of type 'IEngine' could be found (are you missing a using directive or an assembly reference?)

how to set it properly

Davor Joleski [DevOps Enabler] Answered question 26th October 2024

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Davor Joleski [DevOps Enabler]572 Posted 26th October 2024 0 Comments

namespace AutomationScript1_1
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Automation;
using Skyline.DataMiner.Utils.InteractiveAutomationScript;

public class Script
{
private InteractiveController app;
private MaskElementDialog dialog;
private IEngine engine;

/// <summary>
/// The Script entry point.
/// </summary>
/// <param name="engine">Link with SLAutomation process.</param>
public void Run(IEngine engine)
{
try
{
this.engine = engine;
app = new InteractiveController(engine);

engine.SetFlag(RunTimeFlags.NoKeyCaching);
engine.Timeout = TimeSpan.FromHours(10);

RunSafe(engine);
}
catch (ScriptAbortException)
{
throw;
}
catch (ScriptForceAbortException)
{
throw;
}
catch (ScriptTimeoutException)
{
throw;
}
catch (InteractiveUserDetachedException)
{
throw;
}
catch (Exception e)
{
engine.Log("Run|Something went wrong: " + e);
ShowExceptionDialog(engine, e);
}
}

private void RunSafe(IEngine engine)
{
// Define dialogs here
dialog = new MaskElementDialog(engine);
dialog.MaskButton.Pressed += MaskButton_Pressed;

app.ShowDialog(dialog); // Updated to use ShowDialog instead of Run

}

private void MaskButton_Pressed(object sender, EventArgs e)
{
string elem = dialog.ElementDropdown.Selected;
engine.FindElement(elem).Mask("Masked for 3 second",3);
}

private void ShowExceptionDialog(IEngine engine, Exception exception)
{
ExceptionDialog exceptionDialog = new ExceptionDialog(engine, exception);
exceptionDialog.OkButton.Pressed += (sender, args) => engine.ExitFail("Something went wrong.");
if (app.IsRunning)
{
app.ShowDialog(exceptionDialog);
}
else
{
app.ShowDialog(exceptionDialog); // Updated to ShowDialog
}
}
}

public class MaskElementDialog : Dialog
{
private readonly Label helloPapi;
private readonly Label elemPapi;

public MaskElementDialog(IEngine engine) : base(engine)
{
helloPapi = new Label($"Hi {engine.UserDisplayName}, please select an element to mask.");
elemPapi = new Label("Element");

// Update to correct method if GetDms() is not directly available
var getDms = engine.GetDms(); // Ensure GetDms() is available on engine or replace with an appropriate call
ElementDropdown = new DropDown(getDms.GetElements().Select(x => x.Name)) { IsDisplayFilterShown = true, IsSorted = true };
MaskButton = new Button("Mask");

Title = "Mask Element";
AddWidget(helloPapi, 0, 0);
AddWidget(elemPapi, 1, 0);
AddWidget(ElementDropdown, 1, 1);
AddWidget(MaskButton, 2, 0);
}

public DropDown ElementDropdown { get; private set; }

public Button MaskButton { get; private set; }
}
}

Davor Joleski [DevOps Enabler] Answered question 26th October 2024
You are viewing 1 out of 3 answers, click here to view all answers.
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

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin