In the section
Code: Select all
else if (eventID == siPPGEventID.siParameterChange)
{
Code: Select all
if (paramName == "Timezone")
{
int pv = (int)paramValue; //cast to int from object here
string tz = TimeZoneList1[pv];
//update the timezone name with exe scriptcommand
object[] args_tz = new object[3] { Rootername + ".Timezonename", tz, null };
app.ExecuteScriptCommand("SetValue", args_tz);
}
But doing similar for a combobox with:
Code: Select all
if (paramName == "City")
{
app.LogMessage("City changed!", siSeverity.siInfo);
int pvc = (int)paramValue; //cast to int from object here
//app.LogMessage("City selected: " + pvc, siSeverity.siInfo);
//int pvc = 2;
double lg = citylong[pvc];
double lt = citylati[pvc];
int tz = citytmzones[pvc];
object[] args_tz11 = new object[3] { Rootername + ".Longitude", lg, null };
app.ExecuteScriptCommand("SetValue", args_tz11);
object[] args_tz10 = new object[3] { Rootername + ".Latitude", lt, null };
app.ExecuteScriptCommand("SetValue", args_tz10);
object[] args_tz12 = new object[3] { Rootername + ".Timezone", tz, null };
app.ExecuteScriptCommand("SetValue", args_tz12);
object[] args_tz13 = new object[3] { Rootername + ".Timezonename", tz, null };
app.ExecuteScriptCommand("SetValue", args_tz13);
}
Help!!