Exemplo n.º 1
0
 /// <inheritdoc />
 protected override bool OnDeviceConfigChange(Page deviceConfigPage, int deviceRef)
 {
     foreach (AbstractView view in deviceConfigPage.Views)
     {
         if (view.Id == Constants.Devices.DeviceConfigSampleToggleId)
         {
             ToggleView v = view as ToggleView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigSampleToggleId, v.IsEnabled.ToString());
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigSampleCheckBoxId)
         {
             ToggleView v = view as ToggleView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigSampleCheckBoxId, v.IsEnabled.ToString());
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigSelectListId)
         {
             SelectListView v = view as SelectListView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigSelectListId, v.Selection.ToString());
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigRadioSlId)
         {
             SelectListView v = view as SelectListView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigRadioSlId, v.Selection.ToString());
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigInputId)
         {
             InputView v = view as InputView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigInputId, v.Value);
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigTextAreaId)
         {
             TextAreaView v = view as TextAreaView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigTextAreaId, v.Value);
             }
         }
         else if (view.Id == Constants.Devices.DeviceConfigTimeSpanId)
         {
             TimeSpanView v = view as TimeSpanView;
             if (v != null)
             {
                 SetExtraData(deviceRef, Constants.Devices.DeviceConfigTimeSpanId, v.GetStringValue());
             }
         }
     }
     return(true);
 }