public IPlugInAPI.strMultiReturn GetRefreshActionPostUI([AllowNull] NameValueCollection postData, IPlugInAPI.strTrigActInfo actionInfo) { IPlugInAPI.strMultiReturn result = default; result.DataOut = actionInfo.DataIn; result.TrigActInfo = actionInfo; result.sResult = string.Empty; if (postData != null && postData.Count > 0) { RefreshDeviceAction action = (actionInfo.DataIn != null) ? (RefreshDeviceAction)ObjectSerialize.DeSerializeFromBytes(actionInfo.DataIn) : new RefreshDeviceAction(); foreach (var pair in postData) { string text = Convert.ToString(pair, CultureInfo.InvariantCulture); if (!string.IsNullOrWhiteSpace(text) && text.StartsWith(RefreshActionUIDropDownName, StringComparison.Ordinal)) { action.DeviceRefId = Convert.ToInt32(postData[text], CultureInfo.InvariantCulture); } } result.DataOut = ObjectSerialize.SerializeToBytes(action); } return(result); }
public string GetRefreshActionUI(string uniqueControlId, IPlugInAPI.strTrigActInfo actionInfo) { StringBuilder stb = new StringBuilder(); var currentDevices = GetCurrentDeviceImportDevices(); RefreshDeviceAction refreshDeviceAction = ObjectSerialize.DeSerializeFromBytes(actionInfo.DataIn) as RefreshDeviceAction; string selection = string.Empty; if (refreshDeviceAction != null) { selection = refreshDeviceAction.DeviceRefId.ToString(CultureInfo.InvariantCulture); } stb.Append(FormDropDown(RefreshActionUIDropDownName + uniqueControlId, currentDevices, selection, 400, string.Empty, true, "Events")); return(stb.ToString()); }