-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetVar.cs
43 lines (35 loc) · 1.08 KB
/
GetVar.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using Robin.Core;
using Robin.Core.Attributes;
using System.ComponentModel;
using System.Windows.Forms;
using sharpAHK;
namespace Modules.AhkTest8
{
[Action(Order = 6)]
[Throws("ActionError")] // TODO: change error name (or delete if not needed)
public class GetVar : ActionBase
{
[InputArgument]
public AutoHotkey.Interop.AutoHotkeyEngine AhkEngine { get; set; }
[InputArgument, DefaultValue("a")]
public string AhkVariable { get; set; }
[OutputArgument]
public string AhkResult { get; set; }
public override void Execute(ActionContext context)
{
try
{
var ahk = AhkEngine;
var backtoRobin = ahk.GetVar(AhkVariable);
AhkResult = backtoRobin ;
}
catch (Exception e)
{
if (e is ActionException) throw;
throw new ActionException("ActionError", e.Message, e.InnerException);
}
// TODO: set values to Output Arguments here
}
}
}