Hi Paul!
Glad to hear you made the switch to C#! Are you using an IDE at all for your script development?
The reason why setCurrentForm and getCurrentForm are not in the new API is mainly because they were rather limited in functionality, in other words only allowing you to store a single form object. Instead, it is now possible to store arbitrary Types in the Data Dictionary using the Set() and Get() methods, or even Set and Get (where T is an object type). So you were very close with what you suggested!
The syntax would look like this for a Form:
Form myForm = response1.ExtractForm("loginForm");
// using Set - here we don't need to specify the Type
Set("form1", myForm);
// using Set<T> - more explicit way of setting it:
Set<Form>("form1", myForm);
// using Get - here we need to explicitly cast the object to a Form:
Form myForm = (Form)Get("form1");
// using Get<T>
Form myForm = Get<Form>("form1");
Or perhaps for a list of strings:
List<string> dropdownOptions = response1.ExtractList("<option>", "<");
Set("dropDownList", dropdownOptions);
// in any script:
List<string> items = Get<List<string>>("dropDownList");
foreach (string item in items)
{
WriteMessage("item name: " + item);
}
I hope that answers your question. Let me know if you need anything else!
Regards,
Tom