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
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; }
}
}