HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: Jan on April 13, 2014, 12:54:50 PM
-
Just a quick (and probably quite easy to answer) question:
I know that you can access program parameters by calling Program.Parameter().
But you need to know the parameter name for that.
So my question would be: how do I create a loop in c# that runs through all available parameters or input fields of a program and checks or applies settings.
Thanks in advance,
jan
-
Usually a program should know parameter names and what to do with it.
Anyway you can get the instance of a program module like this:
var module = Modules.WithName("The Program Name").Get();
foreach(ModuleParameter p in module.Instance.Properties)
{
//....
}
for details about ModuleParameter class see:
https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/Data/ModuleParameter.cs
Cheers,
g.
-
Hey Gene,
as always, thanks for the quick response and the help!
Now that you explained this, it seems quite logical to create a local instance with the properties by calling the get() function. I'm slowly getting the details ;)
Thanks again,
jan