| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | //using System; |
| | | //using System.Collections.Generic; |
| | | |
| | | namespace Shared.SimpleControl.Phone |
| | | { |
| | | public class AlecaSceneEditPage : FrameLayout |
| | | { |
| | | public AlecaSceneEditPage () |
| | | { |
| | | } |
| | | public void ShowScene (SceneByRegion scene) |
| | | { |
| | | this.BackgroundColor = SkinStyle.Current.MainColor; |
| | | //namespace Shared.SimpleControl.Phone |
| | | //{ |
| | | // public class AlecaSceneEditPage : FrameLayout |
| | | // { |
| | | // public AlecaSceneEditPage () |
| | | // { |
| | | // } |
| | | // public void ShowScene (SceneByRegion scene) |
| | | // { |
| | | // this.BackgroundColor = SkinStyle.Current.MainColor; |
| | | |
| | | #region 标题 |
| | | FrameLayout topView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (126), |
| | | BackgroundColor = SkinStyle.Current.MainColor |
| | | }; |
| | | AddChidren (topView); |
| | | // #region 标题 |
| | | // FrameLayout topView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (126), |
| | | // BackgroundColor = SkinStyle.Current.MainColor |
| | | // }; |
| | | // AddChidren (topView); |
| | | |
| | | var backButton = new Button () { |
| | | Y = Application.GetRealHeight (35), |
| | | Height = Application.GetRealHeight (90), |
| | | Width = Application.GetRealWidth (85), |
| | | UnSelectedImagePath = "Item/Back.png", |
| | | SelectedImagePath = "Item/BackSelected.png", |
| | | }; |
| | | backButton.MouseUpEventHandler += (sender, e) => { |
| | | this.RemoveFromParent (); |
| | | }; |
| | | topView.AddChidren (backButton); |
| | | // var backButton = new Button () { |
| | | // Y = Application.GetRealHeight (35), |
| | | // Height = Application.GetRealHeight (90), |
| | | // Width = Application.GetRealWidth (85), |
| | | // UnSelectedImagePath = "Item/Back.png", |
| | | // SelectedImagePath = "Item/BackSelected.png", |
| | | // }; |
| | | // backButton.MouseUpEventHandler += (sender, e) => { |
| | | // this.RemoveFromParent (); |
| | | // }; |
| | | // topView.AddChidren (backButton); |
| | | |
| | | Button textButton = new Button () { |
| | | Y = Application.GetRealHeight (36), |
| | | Height = Application.GetRealHeight (90), |
| | | Width = Application.GetRealWidth (400), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = scene.SceneName, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextSize = 19, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | topView.AddChidren (textButton); |
| | | // Button textButton = new Button () { |
| | | // Y = Application.GetRealHeight (36), |
| | | // Height = Application.GetRealHeight (90), |
| | | // Width = Application.GetRealWidth (400), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Text = scene.SceneName, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextSize = 19, |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // }; |
| | | // topView.AddChidren (textButton); |
| | | |
| | | Button editor = new Button () { |
| | | X = Application.GetRealWidth (550), |
| | | Y = Application.GetRealHeight (40), |
| | | Height = Application.GetRealHeight (90), |
| | | Width = Application.GetRealWidth (70), |
| | | UnSelectedImagePath = "Item/Editor.png", |
| | | SelectedImagePath = "Item/EditorSelected.png", |
| | | }; |
| | | topView.AddChidren (editor); |
| | | editor.MouseUpEventHandler += (sender, e) => { |
| | | if (editor.IsSelected == true) { |
| | | } else { |
| | | //new ScenePhoneMethod ().AddOrUpdataSceneBaseMassage (roomFilePath, sceneFilePath, (newSceneFilePath) => { |
| | | // sceneFilePath = newSceneFilePath; |
| | | // scene = Scene.GetSceneByFilePath (sceneFilePath); |
| | | // textButton.Text = scene.Name; |
| | | //}); |
| | | } |
| | | }; |
| | | #endregion |
| | | var alldeviceframelayout = new FrameLayout () { |
| | | Width = LayoutParams.MatchParent, |
| | | Height = Application.GetRealHeight (90), |
| | | BackgroundColor = SkinStyle.Current.TitileView, |
| | | Y = topView.Bottom, |
| | | }; |
| | | AddChidren (alldeviceframelayout); |
| | | // Button editor = new Button () { |
| | | // X = Application.GetRealWidth (550), |
| | | // Y = Application.GetRealHeight (40), |
| | | // Height = Application.GetRealHeight (90), |
| | | // Width = Application.GetRealWidth (70), |
| | | // UnSelectedImagePath = "Item/Editor.png", |
| | | // SelectedImagePath = "Item/EditorSelected.png", |
| | | // }; |
| | | // topView.AddChidren (editor); |
| | | // editor.MouseUpEventHandler += (sender, e) => { |
| | | // if (editor.IsSelected == true) { |
| | | // } else { |
| | | // //new ScenePhoneMethod ().AddOrUpdataSceneBaseMassage (roomFilePath, sceneFilePath, (newSceneFilePath) => { |
| | | // // sceneFilePath = newSceneFilePath; |
| | | // // scene = Scene.GetSceneByFilePath (sceneFilePath); |
| | | // // textButton.Text = scene.Name; |
| | | // //}); |
| | | // } |
| | | // }; |
| | | // #endregion |
| | | // var alldeviceframelayout = new FrameLayout () { |
| | | // Width = LayoutParams.MatchParent, |
| | | // Height = Application.GetRealHeight (90), |
| | | // BackgroundColor = SkinStyle.Current.TitileView, |
| | | // Y = topView.Bottom, |
| | | // }; |
| | | // AddChidren (alldeviceframelayout); |
| | | |
| | | var btnEquipmentModel = new Button () { |
| | | Width = LayoutParams.MatchParent, |
| | | Height = Application.GetRealHeight (90), |
| | | X = Application.GetRealWidth (30), |
| | | TextID = R.MyInternationalizationString.DeviceList, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextSize = 15, |
| | | BackgroundColor = SkinStyle.Current.TitileView |
| | | }; |
| | | alldeviceframelayout.AddChidren (btnEquipmentModel); |
| | | // var btnEquipmentModel = new Button () { |
| | | // Width = LayoutParams.MatchParent, |
| | | // Height = Application.GetRealHeight (90), |
| | | // X = Application.GetRealWidth (30), |
| | | // TextID = R.MyInternationalizationString.DeviceList, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextSize = 15, |
| | | // BackgroundColor = SkinStyle.Current.TitileView |
| | | // }; |
| | | // alldeviceframelayout.AddChidren (btnEquipmentModel); |
| | | |
| | | #region 根据添加设备的顺序排列设备 |
| | | var deviceListView = new VerticalScrolViewLayout () { |
| | | Height = Application.GetRealHeight (1136 - 126 - 90 - 90), |
| | | Y = alldeviceframelayout.Bottom, |
| | | BackgroundColor = SkinStyle.Current.ViewColor |
| | | }; |
| | | AddChidren (deviceListView); |
| | | List<SceneObjectiveRes> deviceList = new List<SceneObjectiveRes> (); |
| | | System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Start ("Please wait..."); |
| | | }); |
| | | deviceList = ReadSceneDeviceList (scene.SceneId); |
| | | // #region 根据添加设备的顺序排列设备 |
| | | // var deviceListView = new VerticalScrolViewLayout () { |
| | | // Height = Application.GetRealHeight (1136 - 126 - 90 - 90), |
| | | // Y = alldeviceframelayout.Bottom, |
| | | // BackgroundColor = SkinStyle.Current.ViewColor |
| | | // }; |
| | | // AddChidren (deviceListView); |
| | | // List<SceneObjectiveRes> deviceList = new List<SceneObjectiveRes> (); |
| | | // System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | // Application.RunOnMainThread (() => { |
| | | // MainPage.Loading.Start ("Please wait..."); |
| | | // }); |
| | | // deviceList = ReadSceneDeviceList (scene.SceneId); |
| | | |
| | | Application.RunOnMainThread (() => { |
| | | foreach (var device in deviceList) { |
| | | var rowView = new RowLayout () { |
| | | Height = Application.GetRealHeight (100), |
| | | }; |
| | | deviceListView.AddChidren (rowView); |
| | | var btnDevice = new Button () { |
| | | X = Application.GetRealWidth (60), |
| | | Width = Application.GetRealWidth (500), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = device.DeviceName, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | rowView.AddChidren (btnDevice); |
| | | // Application.RunOnMainThread (() => { |
| | | // foreach (var device in deviceList) { |
| | | // var rowView = new RowLayout () { |
| | | // Height = Application.GetRealHeight (100), |
| | | // }; |
| | | // deviceListView.AddChidren (rowView); |
| | | // var btnDevice = new Button () { |
| | | // X = Application.GetRealWidth (60), |
| | | // Width = Application.GetRealWidth (500), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // Text = device.DeviceName, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // rowView.AddChidren (btnDevice); |
| | | |
| | | var btnDelDevice = new Button () { |
| | | Text = "Delete", |
| | | BackgroundColor = SkinStyle.Current.DelColor, |
| | | }; |
| | | rowView.AddRightView (btnDelDevice); |
| | | btnDelDevice.MouseUpEventHandler += (dd, ff) => { |
| | | System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | try { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Start ("Please wait..."); |
| | | }); |
| | | var delObj = new RemoveBindSceneToDevicesItemObj () { SceneOBJId = new byte [] { (byte)device.SceneOBJId } }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (deviceList); |
| | | var revertObj = MainPage.RequestHttps ("RemoveBindSceneToDevicesItem", requestJson); |
| | | if (revertObj.StateCode == "SUCCESS") { |
| | | Application.RunOnMainThread (() => { |
| | | this.RemoveFromParent (); |
| | | }); |
| | | } |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.Message); |
| | | } finally { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Hide (); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | } |
| | | }); |
| | | }); |
| | | // var btnDelDevice = new Button () { |
| | | // Text = "Delete", |
| | | // BackgroundColor = SkinStyle.Current.DelColor, |
| | | // }; |
| | | // rowView.AddRightView (btnDelDevice); |
| | | // btnDelDevice.MouseUpEventHandler += (dd, ff) => { |
| | | // System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | // try { |
| | | // Application.RunOnMainThread (() => { |
| | | // MainPage.Loading.Start ("Please wait..."); |
| | | // }); |
| | | // //var delObj = new RemoveBindSceneToDevicesItemObj () { SceneOBJId = new byte [] { (byte)device.SceneOBJId } }; |
| | | // var delObj = new UnBindSceneObj () { Id = device.SceneOBJId.ToString() }; |
| | | // var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (deviceList); |
| | | // var revertObj = MainPage.RequestHttps (API.UnBindSceneObj, requestJson, true); |
| | | // if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | // Application.RunOnMainThread (() => { |
| | | // this.RemoveFromParent (); |
| | | // }); |
| | | // } |
| | | // } catch (Exception ex) { |
| | | // Console.WriteLine (ex.Message); |
| | | // } finally { |
| | | // Application.RunOnMainThread (() => { |
| | | // MainPage.Loading.Hide (); |
| | | // }); |
| | | // } |
| | | // }); |
| | | // }; |
| | | // } |
| | | // }); |
| | | // }); |
| | | |
| | | #endregion |
| | | // #endregion |
| | | |
| | | Button btnAddDevice = new Button () { |
| | | Width = LayoutParams.MatchParent, |
| | | Height = Application.GetRealHeight (80), |
| | | Y = Application.GetRealHeight (1136 - 80), |
| | | BackgroundColor = SkinStyle.Current.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = R.MyInternationalizationString.SAVE, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | AddChidren (btnAddDevice); |
| | | // Button btnAddDevice = new Button () { |
| | | // Width = LayoutParams.MatchParent, |
| | | // Height = Application.GetRealHeight (80), |
| | | // Y = Application.GetRealHeight (1136 - 80), |
| | | // BackgroundColor = SkinStyle.Current.MainColor, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextID = R.MyInternationalizationString.SAVE, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // AddChidren (btnAddDevice); |
| | | |
| | | btnAddDevice.MouseUpEventHandler += (ssd, e) => { |
| | | System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | try { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Start ("Please wait..."); |
| | | }); |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (deviceList); |
| | | var revertObj = MainPage.RequestHttps ("SceneByRegionList", requestJson); |
| | | if (revertObj.StateCode == "SUCCESS") { |
| | | Application.RunOnMainThread (() => { |
| | | this.RemoveFromParent (); |
| | | }); |
| | | } |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.Message); |
| | | } finally { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Hide (); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | } |
| | | // btnAddDevice.MouseUpEventHandler += (ssd, e) => { |
| | | // System.Threading.Tasks.Task.Factory.StartNew (() => { |
| | | // try { |
| | | // Application.RunOnMainThread (() => { |
| | | // MainPage.Loading.Start ("Please wait..."); |
| | | // }); |
| | | // //SceneObjectiveRes |
| | | // var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (deviceList); |
| | | // var revertObj = MainPage.RequestHttps ("SceneByRegionList", requestJson, true); |
| | | // if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | // Application.RunOnMainThread (() => { |
| | | // this.RemoveFromParent (); |
| | | // }); |
| | | // } |
| | | // } catch (Exception ex) { |
| | | // Console.WriteLine (ex.Message); |
| | | // } finally { |
| | | // Application.RunOnMainThread (() => { |
| | | // MainPage.Loading.Hide (); |
| | | // }); |
| | | // } |
| | | // }); |
| | | // }; |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 读取场景设备列表 |
| | | /// </summary> |
| | | public List<SceneObjectiveRes> ReadSceneDeviceList (int id ) |
| | | { |
| | | var sceneList = new List<SceneObjectiveRes> (); |
| | | var requestObj = new GetBindDeviceBySceneListObj () { Id = id}; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); |
| | | var revertObj = MainPage.RequestHttps ("SceneByRegionList", requestJson); |
| | | if (revertObj.StateCode == "SUCCESS") { |
| | | sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SceneObjectiveRes>> (revertObj.ResponseData.ToString ()); |
| | | } |
| | | return sceneList; |
| | | } |
| | | // /// <summary> |
| | | // /// 读取场景设备列表 |
| | | // /// </summary> |
| | | // public List<SceneObjectiveRes> ReadSceneDeviceList (string id ) |
| | | // { |
| | | // var sceneList = new List<SceneObjectiveRes> (); |
| | | // var requestObj = new GetBindDeviceBySceneListObj () { Id = id}; |
| | | // var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); |
| | | // var revertObj = MainPage.RequestHttps ("SceneByRegionList", requestJson, true); |
| | | // if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | // sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SceneObjectiveRes>> (revertObj.ResponseData.ToString ()); |
| | | // } |
| | | // return sceneList; |
| | | // } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 显示出对应的场景数据 |
| | | /// </summary> |
| | | public void SetDialogForAddEquipment (SceneObjectiveRes device) |
| | | { |
| | | var deviceType = device.DeviceType; |
| | | #region initpublicView |
| | | Dialog dialog = new Dialog (); |
| | | FrameLayout dialogBodyLayout = new FrameLayout () { |
| | | BackgroundColor = SkinStyle.Current.SceneDialogColor, |
| | | Width = Application.GetRealWidth (480), |
| | | Height = Application.GetRealHeight (560), |
| | | Radius = 5, |
| | | BorderWidth = 0, |
| | | BorderColor = SkinStyle.Current.Transparent, |
| | | Gravity = Gravity.Center |
| | | }; |
| | | dialog.AddChidren (dialogBodyLayout); |
| | | // /// <summary> |
| | | // /// 显示出对应的场景数据 |
| | | // /// </summary> |
| | | // public void SetDialogForAddEquipment (SceneObjectiveRes device) |
| | | // { |
| | | // var deviceType = device.DeviceType; |
| | | // #region initpublicView |
| | | // Dialog dialog = new Dialog (); |
| | | // FrameLayout dialogBodyLayout = new FrameLayout () { |
| | | // BackgroundColor = SkinStyle.Current.SceneDialogColor, |
| | | // Width = Application.GetRealWidth (480), |
| | | // Height = Application.GetRealHeight (560), |
| | | // Radius = 5, |
| | | // BorderWidth = 0, |
| | | // BorderColor = SkinStyle.Current.Transparent, |
| | | // Gravity = Gravity.Center |
| | | // }; |
| | | // dialog.AddChidren (dialogBodyLayout); |
| | | |
| | | FrameLayout titleView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (80), |
| | | BackgroundColor = SkinStyle.Current.SceneDialogTitleColor, |
| | | }; |
| | | dialogBodyLayout.AddChidren (titleView); |
| | | Button title = new Button () { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = SkinStyle.Current.DialogTextColor, |
| | | Text = device.DeviceName |
| | | }; |
| | | titleView.AddChidren (title); |
| | | // FrameLayout titleView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (80), |
| | | // BackgroundColor = SkinStyle.Current.SceneDialogTitleColor, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (titleView); |
| | | // Button title = new Button () { |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = SkinStyle.Current.DialogTextColor, |
| | | // Text = device.DeviceName |
| | | // }; |
| | | // titleView.AddChidren (title); |
| | | |
| | | FrameLayout bottomView = new FrameLayout () { |
| | | Y = Application.GetRealHeight (560 - 80), |
| | | BackgroundColor = SkinStyle.Current.SceneDialogTitleColor, |
| | | Height = Application.GetRealHeight (83), |
| | | }; |
| | | dialogBodyLayout.AddChidren (bottomView); |
| | | Button btnBack = new Button () { |
| | | Width = Application.GetRealWidth (239), |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | }; |
| | | bottomView.AddChidren (btnBack); |
| | | btnBack.MouseUpEventHandler += (sender2, e2) => { |
| | | dialog.Close (); |
| | | }; |
| | | Button btnLine = new Button () { |
| | | BackgroundColor = SkinStyle.Current.White20Transparent, |
| | | Width = 1, |
| | | X = btnBack.Right, |
| | | }; |
| | | bottomView.AddChidren (btnLine); |
| | | var btnSave = new Button () { |
| | | Width = Application.GetRealWidth (239), |
| | | X = btnLine.Right, |
| | | TextID = R.MyInternationalizationString.SAVE, |
| | | }; |
| | | bottomView.AddChidren (btnSave); |
| | | #endregion |
| | | // FrameLayout bottomView = new FrameLayout () { |
| | | // Y = Application.GetRealHeight (560 - 80), |
| | | // BackgroundColor = SkinStyle.Current.SceneDialogTitleColor, |
| | | // Height = Application.GetRealHeight (83), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (bottomView); |
| | | // Button btnBack = new Button () { |
| | | // Width = Application.GetRealWidth (239), |
| | | // TextID = R.MyInternationalizationString.Cancel, |
| | | // }; |
| | | // bottomView.AddChidren (btnBack); |
| | | // btnBack.MouseUpEventHandler += (sender2, e2) => { |
| | | // dialog.Close (); |
| | | // }; |
| | | // Button btnLine = new Button () { |
| | | // BackgroundColor = SkinStyle.Current.White20Transparent, |
| | | // Width = 1, |
| | | // X = btnBack.Right, |
| | | // }; |
| | | // bottomView.AddChidren (btnLine); |
| | | // var btnSave = new Button () { |
| | | // Width = Application.GetRealWidth (239), |
| | | // X = btnLine.Right, |
| | | // TextID = R.MyInternationalizationString.SAVE, |
| | | // }; |
| | | // bottomView.AddChidren (btnSave); |
| | | // #endregion |
| | | |
| | | if (deviceType == DeviceType.LightSwitch.ToString () || deviceType == DeviceType.LightEnergySwitch.ToString () || deviceType == DeviceType.LightEnergySocket.ToString () || deviceType == DeviceType.LightSwitchSocket.ToString () |
| | | || deviceType == DeviceType.LightMixSwitch.ToString ()) { |
| | | #region |
| | | var btnOn = new Button () { |
| | | Width = Application.GetRealWidth (150), |
| | | Height = Application.GetRealHeight (70), |
| | | X = Application.GetRealWidth (70), |
| | | Y = Application.GetRealHeight (320), |
| | | BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | BorderWidth = 0, |
| | | Radius = 5, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | BorderColor = SkinStyle.Current.BorderColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = R.MyInternationalizationString.ON, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOn); |
| | | var btnOff = new Button () { |
| | | Width = Application.GetRealWidth (150), |
| | | Height = Application.GetRealHeight (70), |
| | | X = btnOn.Right + Application.GetRealWidth (40), |
| | | Y = Application.GetRealHeight (320), |
| | | BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | BorderWidth = 0, |
| | | Radius = 5, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | BorderColor = SkinStyle.Current.BorderColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = R.MyInternationalizationString.OFF, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOff); |
| | | // if (deviceType == DeviceType.LightSwitch.ToString () || deviceType == DeviceType.LightEnergySwitch.ToString () || deviceType == DeviceType.LightEnergySocket.ToString () || deviceType == DeviceType.LightSwitchSocket.ToString () |
| | | // || deviceType == DeviceType.LightMixSwitch.ToString ()) { |
| | | // #region |
| | | // var btnOn = new Button () { |
| | | // Width = Application.GetRealWidth (150), |
| | | // Height = Application.GetRealHeight (70), |
| | | // X = Application.GetRealWidth (70), |
| | | // Y = Application.GetRealHeight (320), |
| | | // BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | // SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | // BorderWidth = 0, |
| | | // Radius = 5, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // BorderColor = SkinStyle.Current.BorderColor, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextID = R.MyInternationalizationString.ON, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOn); |
| | | // var btnOff = new Button () { |
| | | // Width = Application.GetRealWidth (150), |
| | | // Height = Application.GetRealHeight (70), |
| | | // X = btnOn.Right + Application.GetRealWidth (40), |
| | | // Y = Application.GetRealHeight (320), |
| | | // BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | // SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | // BorderWidth = 0, |
| | | // Radius = 5, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // BorderColor = SkinStyle.Current.BorderColor, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextID = R.MyInternationalizationString.OFF, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOff); |
| | | |
| | | if (device.DataStrings == "0") { |
| | | btnOn.IsSelected = false; |
| | | btnOff.IsSelected = true; |
| | | } else { |
| | | btnOn.IsSelected = true; |
| | | btnOff.IsSelected = false; |
| | | } |
| | | // if (device.DataStrings == "0") { |
| | | // btnOn.IsSelected = false; |
| | | // btnOff.IsSelected = true; |
| | | // } else { |
| | | // btnOn.IsSelected = true; |
| | | // btnOff.IsSelected = false; |
| | | // } |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | btnOn.IsSelected = true; |
| | | btnOff.IsSelected = false; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | btnOn.IsSelected = false; |
| | | btnOff.IsSelected = true; |
| | | }; |
| | | // btnOn.MouseUpEventHandler += (sender, e) => { |
| | | // btnOn.IsSelected = true; |
| | | // btnOff.IsSelected = false; |
| | | // }; |
| | | // btnOff.MouseUpEventHandler += (sender, e) => { |
| | | // btnOn.IsSelected = false; |
| | | // btnOff.IsSelected = true; |
| | | // }; |
| | | |
| | | #endregion |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | device.DataStrings = btnOn.IsSelected == true ? "100" : "0"; |
| | | dialog.Close (); |
| | | }; |
| | | } else if (deviceType == DeviceType.LightDimming.ToString () || deviceType == DeviceType.LightDALI.ToString () || deviceType == DeviceType.LightMixDimming.ToString ()) { |
| | | #region |
| | | var lblChangeName = new Button () { |
| | | X = Application.GetRealWidth (30), |
| | | Y = Application.GetRealHeight (100), |
| | | Width = Application.GetRealWidth (420), |
| | | Height = Application.GetRealHeight (70), |
| | | TextID = R.MyInternationalizationString.DelayTime, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | dialogBodyLayout.AddChidren (lblChangeName); |
| | | // #endregion |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // device.DataStrings = btnOn.IsSelected == true ? "100" : "0"; |
| | | // dialog.Close (); |
| | | // }; |
| | | // } else if (deviceType == DeviceType.LightDimming.ToString () || deviceType == DeviceType.LightDALI.ToString () || deviceType == DeviceType.LightMixDimming.ToString ()) { |
| | | // #region |
| | | // var lblChangeName = new Button () { |
| | | // X = Application.GetRealWidth (30), |
| | | // Y = Application.GetRealHeight (100), |
| | | // Width = Application.GetRealWidth (420), |
| | | // Height = Application.GetRealHeight (70), |
| | | // TextID = R.MyInternationalizationString.DelayTime, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (lblChangeName); |
| | | |
| | | |
| | | var tempSeekBarFrame = new FrameLayout () { |
| | | Width = Application.GetRealWidth (520 - 200), |
| | | Height = Application.GetRealHeight (80), |
| | | X = Application.GetRealWidth (70), |
| | | Y = Application.GetRealHeight (300), |
| | | }; |
| | | dialogBodyLayout.AddChidren (tempSeekBarFrame); |
| | | var horizontalSeekBar = new HorizontalSeekBar () { |
| | | Tag = DateTime.MinValue, |
| | | ThumbColor = SkinStyle.Current.ThumbColor2 |
| | | }; |
| | | tempSeekBarFrame.AddChidren (horizontalSeekBar); |
| | | horizontalSeekBar.Progress = Convert.ToInt32 (device.DataStrings); |
| | | Button btnMaxBrightness = new Button () { |
| | | Width = Application.GetRealWidth (90), |
| | | Height = Application.GetRealHeight (80), |
| | | X = tempSeekBarFrame.Right + Application.GetRealWidth (10), |
| | | Y = Application.GetRealHeight (300), |
| | | Text = Convert.ToInt32 (device.DataStrings) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor1 |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | Console.WriteLine (DateTime.Now.ToString ()); |
| | | btnMaxBrightness.Text = horizontalSeekBar.Progress + "%"; |
| | | }; |
| | | // var tempSeekBarFrame = new FrameLayout () { |
| | | // Width = Application.GetRealWidth (520 - 200), |
| | | // Height = Application.GetRealHeight (80), |
| | | // X = Application.GetRealWidth (70), |
| | | // Y = Application.GetRealHeight (300), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (tempSeekBarFrame); |
| | | // var horizontalSeekBar = new HorizontalSeekBar () { |
| | | // Tag = DateTime.MinValue, |
| | | // ThumbColor = SkinStyle.Current.ThumbColor2 |
| | | // }; |
| | | // tempSeekBarFrame.AddChidren (horizontalSeekBar); |
| | | // horizontalSeekBar.Progress = Convert.ToInt32 (device.DataStrings); |
| | | // Button btnMaxBrightness = new Button () { |
| | | // Width = Application.GetRealWidth (90), |
| | | // Height = Application.GetRealHeight (80), |
| | | // X = tempSeekBarFrame.Right + Application.GetRealWidth (10), |
| | | // Y = Application.GetRealHeight (300), |
| | | // Text = Convert.ToInt32 (device.DataStrings) + "%", |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor1 |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | // horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | // Console.WriteLine (DateTime.Now.ToString ()); |
| | | // btnMaxBrightness.Text = horizontalSeekBar.Progress + "%"; |
| | | // }; |
| | | |
| | | #endregion |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | device.DataStrings = btnMaxBrightness.Text.Remove ('%'); |
| | | dialog.Close (); |
| | | }; |
| | | } else if (deviceType == DeviceType.LightRGB.ToString ()) { |
| | | dialogBodyLayout.Height = Application.GetRealHeight (1136); |
| | | dialogBodyLayout.Width = Application.GetRealHeight (640); |
| | | dialogBodyLayout.Gravity = Gravity.Center; |
| | | // #endregion |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // device.DataStrings = btnMaxBrightness.Text.Remove ('%'); |
| | | // dialog.Close (); |
| | | // }; |
| | | // } else if (deviceType == DeviceType.LightRGB.ToString ()) { |
| | | // dialogBodyLayout.Height = Application.GetRealHeight (1136); |
| | | // dialogBodyLayout.Width = Application.GetRealHeight (640); |
| | | // dialogBodyLayout.Gravity = Gravity.Center; |
| | | |
| | | var lighting = Convert.ToInt32 (device.DataStrings.Split (",") [0]); |
| | | var rColor = Convert.ToInt32 (device.DataStrings.Split (",") [1]); |
| | | var gColor = Convert.ToInt32 (device.DataStrings.Split (",") [2]); |
| | | var bColor = Convert.ToInt32 (device.DataStrings.Split (",") [3]); |
| | | // var lighting = Convert.ToInt32 (device.DataStrings.Split (",") [0]); |
| | | // var rColor = Convert.ToInt32 (device.DataStrings.Split (",") [1]); |
| | | // var gColor = Convert.ToInt32 (device.DataStrings.Split (",") [2]); |
| | | // var bColor = Convert.ToInt32 (device.DataStrings.Split (",") [3]); |
| | | |
| | | Button btnTopNull = new Button () { |
| | | Height = Application.GetRealHeight (36), |
| | | BackgroundColor = SkinStyle.Current.MainColor, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnTopNull); |
| | | // Button btnTopNull = new Button () { |
| | | // Height = Application.GetRealHeight (36), |
| | | // BackgroundColor = SkinStyle.Current.MainColor, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnTopNull); |
| | | |
| | | Button btnTitle = new Button () { |
| | | Y = Application.GetRealHeight (36), |
| | | Height = Application.GetRealHeight (90), |
| | | TextAlignment = TextAlignment.Center, |
| | | Enable = false, |
| | | Text = device.DeviceName, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | BackgroundColor = SkinStyle.Current.MainColor, |
| | | TextSize = 19 |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnTitle); |
| | | // Button btnTitle = new Button () { |
| | | // Y = Application.GetRealHeight (36), |
| | | // Height = Application.GetRealHeight (90), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Enable = false, |
| | | // Text = device.DeviceName, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // BackgroundColor = SkinStyle.Current.MainColor, |
| | | // TextSize = 19 |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnTitle); |
| | | |
| | | Button btnColor = new Button () { |
| | | Width = Application.GetRealWidth (100), |
| | | Height = Application.GetRealHeight (40), |
| | | X = Application.GetRealWidth (20), |
| | | Y = btnTitle.Bottom + Application.GetRealHeight (50), |
| | | Radius = 5, |
| | | BackgroundColor = (uint)(0xFF000000 + rColor * 256 * 256 + gColor * 256 + bColor) |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnColor); |
| | | Button btnColorText = new Button () { |
| | | Width = Application.GetRealWidth (100), |
| | | Height = Application.GetRealHeight (40), |
| | | X = btnColor.X, |
| | | Y = btnColor.Bottom, |
| | | TextColor = SkinStyle.Current.TextColor, |
| | | Text = "Color" |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnColorText); |
| | | // Button btnColor = new Button () { |
| | | // Width = Application.GetRealWidth (100), |
| | | // Height = Application.GetRealHeight (40), |
| | | // X = Application.GetRealWidth (20), |
| | | // Y = btnTitle.Bottom + Application.GetRealHeight (50), |
| | | // Radius = 5, |
| | | // BackgroundColor = (uint)(0xFF000000 + rColor * 256 * 256 + gColor * 256 + bColor) |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnColor); |
| | | // Button btnColorText = new Button () { |
| | | // Width = Application.GetRealWidth (100), |
| | | // Height = Application.GetRealHeight (40), |
| | | // X = btnColor.X, |
| | | // Y = btnColor.Bottom, |
| | | // TextColor = SkinStyle.Current.TextColor, |
| | | // Text = "Color" |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnColorText); |
| | | |
| | | ColorPicker c = new ColorPicker () { |
| | | X = Application.GetRealWidth (140), |
| | | Y = btnTitle.Bottom + Application.GetRealHeight (30), |
| | | Width = Application.GetMinRealAverage (440), |
| | | Height = Application.GetMinRealAverage (440), |
| | | ColorImagePath = "Item/PickerColorWheel.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (c); |
| | | // ColorPicker c = new ColorPicker () { |
| | | // X = Application.GetRealWidth (140), |
| | | // Y = btnTitle.Bottom + Application.GetRealHeight (30), |
| | | // Width = Application.GetMinRealAverage (440), |
| | | // Height = Application.GetMinRealAverage (440), |
| | | // ColorImagePath = "Item/PickerColorWheel.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (c); |
| | | |
| | | DateTime colorChangeTime = DateTime.MinValue; |
| | | c.ColorChaged += (sender2, e2) => { |
| | | if ((DateTime.Now - colorChangeTime).TotalMilliseconds > 50) { |
| | | rColor = e2 [0]; |
| | | gColor = e2 [1]; |
| | | bColor = e2 [2]; |
| | | colorChangeTime = DateTime.Now; |
| | | } |
| | | }; |
| | | // DateTime colorChangeTime = DateTime.MinValue; |
| | | // c.ColorChaged += (sender2, e2) => { |
| | | // if ((DateTime.Now - colorChangeTime).TotalMilliseconds > 50) { |
| | | // rColor = e2 [0]; |
| | | // gColor = e2 [1]; |
| | | // bColor = e2 [2]; |
| | | // colorChangeTime = DateTime.Now; |
| | | // } |
| | | // }; |
| | | |
| | | HorizontalSeekBar seekBarLighting = new HorizontalSeekBar () { |
| | | X = Application.GetRealWidth (50), |
| | | Y = c.Bottom + Application.GetRealHeight (260), |
| | | Width = Application.GetRealWidth (500), |
| | | Height = Application.GetRealHeight (50), |
| | | Progress = lighting, |
| | | ThumbColor = SkinStyle.Current.ThumbColor2, |
| | | Max = 100, |
| | | }; |
| | | dialogBodyLayout.AddChidren (seekBarLighting); |
| | | Button btnLightingText = new Button () { |
| | | X = seekBarLighting.Right + Application.GetRealWidth (5), |
| | | Y = seekBarLighting.Y, |
| | | Width = Application.GetRealWidth (80), |
| | | Height = Application.GetRealHeight (50), |
| | | TextColor = SkinStyle.Current.TextColor, |
| | | Text = lighting + "%", |
| | | TextSize = 12 |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnLightingText); |
| | | seekBarLighting.ProgressChanged += (sender3, e3) => { |
| | | lighting = (byte)e3; |
| | | }; |
| | | bottomView.RemoveFromParent (); |
| | | //dialogBodyLayout.Remove (bottomView); |
| | | // HorizontalSeekBar seekBarLighting = new HorizontalSeekBar () { |
| | | // X = Application.GetRealWidth (50), |
| | | // Y = c.Bottom + Application.GetRealHeight (260), |
| | | // Width = Application.GetRealWidth (500), |
| | | // Height = Application.GetRealHeight (50), |
| | | // Progress = lighting, |
| | | // ThumbColor = SkinStyle.Current.ThumbColor2, |
| | | // Max = 100, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (seekBarLighting); |
| | | // Button btnLightingText = new Button () { |
| | | // X = seekBarLighting.Right + Application.GetRealWidth (5), |
| | | // Y = seekBarLighting.Y, |
| | | // Width = Application.GetRealWidth (80), |
| | | // Height = Application.GetRealHeight (50), |
| | | // TextColor = SkinStyle.Current.TextColor, |
| | | // Text = lighting + "%", |
| | | // TextSize = 12 |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnLightingText); |
| | | // seekBarLighting.ProgressChanged += (sender3, e3) => { |
| | | // lighting = (byte)e3; |
| | | // }; |
| | | // bottomView.RemoveFromParent (); |
| | | // //dialogBodyLayout.Remove (bottomView); |
| | | |
| | | bottomView = new FrameLayout () { |
| | | Y = Application.GetRealHeight (1136 - 90), |
| | | Height = Application.GetRealHeight (95), |
| | | BackgroundColor = SkinStyle.Current.MainColor |
| | | }; |
| | | dialogBodyLayout.AddChidren (bottomView); |
| | | Button btnCancel = new Button () { |
| | | Width = Application.GetRealWidth (318), |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | }; |
| | | bottomView.AddChidren (btnCancel); |
| | | btnCancel.MouseUpEventHandler += (sender2, e2) => { |
| | | dialog.Close (); |
| | | }; |
| | | btnLine = new Button () { |
| | | BackgroundColor = SkinStyle.Current.Black50Transparent, |
| | | Width = 1, |
| | | X = btnCancel.Right, |
| | | }; |
| | | bottomView.AddChidren (btnLine); |
| | | btnSave = new Button () { |
| | | Width = Application.GetRealWidth (318), |
| | | X = btnLine.Right, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextID = R.MyInternationalizationString.SAVE |
| | | }; |
| | | bottomView.AddChidren (btnSave); |
| | | // bottomView = new FrameLayout () { |
| | | // Y = Application.GetRealHeight (1136 - 90), |
| | | // Height = Application.GetRealHeight (95), |
| | | // BackgroundColor = SkinStyle.Current.MainColor |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (bottomView); |
| | | // Button btnCancel = new Button () { |
| | | // Width = Application.GetRealWidth (318), |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextID = R.MyInternationalizationString.Cancel, |
| | | // }; |
| | | // bottomView.AddChidren (btnCancel); |
| | | // btnCancel.MouseUpEventHandler += (sender2, e2) => { |
| | | // dialog.Close (); |
| | | // }; |
| | | // btnLine = new Button () { |
| | | // BackgroundColor = SkinStyle.Current.Black50Transparent, |
| | | // Width = 1, |
| | | // X = btnCancel.Right, |
| | | // }; |
| | | // bottomView.AddChidren (btnLine); |
| | | // btnSave = new Button () { |
| | | // Width = Application.GetRealWidth (318), |
| | | // X = btnLine.Right, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextID = R.MyInternationalizationString.SAVE |
| | | // }; |
| | | // bottomView.AddChidren (btnSave); |
| | | |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | device.DataStrings = lighting + "," + rColor + "," + gColor + "," + bColor; |
| | | dialog.Close (); |
| | | }; |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // device.DataStrings = lighting + "," + rColor + "," + gColor + "," + bColor; |
| | | // dialog.Close (); |
| | | // }; |
| | | |
| | | } else if (deviceType == DeviceType.CurtainModel.ToString () || deviceType == DeviceType.CurtainTrietex.ToString () || deviceType == DeviceType.CurtainRoller.ToString ()) { |
| | | if (deviceType == DeviceType.CurtainModel.ToString ()) { |
| | | #region CurtainModelView |
| | | // } else if (deviceType == DeviceType.CurtainModel.ToString () || deviceType == DeviceType.CurtainTrietex.ToString () || deviceType == DeviceType.CurtainRoller.ToString ()) { |
| | | // if (deviceType == DeviceType.CurtainModel.ToString ()) { |
| | | // #region CurtainModelView |
| | | |
| | | Button btnOpenCurtain = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (125), |
| | | UnSelectedImagePath = "Curtain/CurtainOpen.png", |
| | | SelectedImagePath = "Curtain/CurtainOpenSelected.png", |
| | | X = Application.GetRealWidth (20), |
| | | Y = Application.GetRealHeight (155), |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOpenCurtain); |
| | | Button btnOpenLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | | X = btnOpenCurtain.X, |
| | | Y = btnOpenCurtain.Bottom + Application.GetRealHeight (5), |
| | | TextID = R.MyInternationalizationString.Open, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOpenLbl); |
| | | Button btnStopCurtain = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (125), |
| | | X = Application.GetRealWidth ((480 - 124) / 2), |
| | | Y = btnOpenCurtain.Y, |
| | | UnSelectedImagePath = "Curtain/CurtainTimeOut.png", |
| | | SelectedImagePath = "Curtain/CurtainTimeOutSelected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnStopCurtain); |
| | | Button btnStopLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | | X = btnStopCurtain.X, |
| | | Y = btnOpenLbl.Y, |
| | | TextID = R.MyInternationalizationString.Stop, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnStopLbl); |
| | | Button btnCloseCurtain = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (125), |
| | | X = Application.GetRealWidth (480 - 124 - 35), |
| | | Y = btnOpenCurtain.Y, |
| | | UnSelectedImagePath = "Curtain/CurtainClose.png", |
| | | SelectedImagePath = "Curtain/CurtainCloseSelected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseCurtain); |
| | | Button btnCloseLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | | X = btnCloseCurtain.X, |
| | | Y = btnOpenLbl.Y, |
| | | TextID = R.MyInternationalizationString.Close, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseLbl); |
| | | btnCloseCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = true; |
| | | btnOpenCurtain.IsSelected = false; |
| | | btnStopCurtain.IsSelected = false; |
| | | }; |
| | | btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = true; |
| | | btnStopCurtain.IsSelected = false; |
| | | }; |
| | | btnStopCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = false; |
| | | btnStopCurtain.IsSelected = true; |
| | | }; |
| | | if (device.DataStrings == "0") { |
| | | btnStopCurtain.IsSelected = true; |
| | | } else if (device.DataStrings == "1") { |
| | | btnOpenCurtain.IsSelected = true; |
| | | } else if (device.DataStrings == "2") { |
| | | btnCloseCurtain.IsSelected = true; |
| | | } |
| | | // Button btnOpenCurtain = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (125), |
| | | // UnSelectedImagePath = "Curtain/CurtainOpen.png", |
| | | // SelectedImagePath = "Curtain/CurtainOpenSelected.png", |
| | | // X = Application.GetRealWidth (20), |
| | | // Y = Application.GetRealHeight (155), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOpenCurtain); |
| | | // Button btnOpenLbl = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (30), |
| | | // X = btnOpenCurtain.X, |
| | | // Y = btnOpenCurtain.Bottom + Application.GetRealHeight (5), |
| | | // TextID = R.MyInternationalizationString.Open, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOpenLbl); |
| | | // Button btnStopCurtain = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (125), |
| | | // X = Application.GetRealWidth ((480 - 124) / 2), |
| | | // Y = btnOpenCurtain.Y, |
| | | // UnSelectedImagePath = "Curtain/CurtainTimeOut.png", |
| | | // SelectedImagePath = "Curtain/CurtainTimeOutSelected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnStopCurtain); |
| | | // Button btnStopLbl = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (30), |
| | | // X = btnStopCurtain.X, |
| | | // Y = btnOpenLbl.Y, |
| | | // TextID = R.MyInternationalizationString.Stop, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnStopLbl); |
| | | // Button btnCloseCurtain = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (125), |
| | | // X = Application.GetRealWidth (480 - 124 - 35), |
| | | // Y = btnOpenCurtain.Y, |
| | | // UnSelectedImagePath = "Curtain/CurtainClose.png", |
| | | // SelectedImagePath = "Curtain/CurtainCloseSelected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnCloseCurtain); |
| | | // Button btnCloseLbl = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (30), |
| | | // X = btnCloseCurtain.X, |
| | | // Y = btnOpenLbl.Y, |
| | | // TextID = R.MyInternationalizationString.Close, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnCloseLbl); |
| | | // btnCloseCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | // btnCloseCurtain.IsSelected = true; |
| | | // btnOpenCurtain.IsSelected = false; |
| | | // btnStopCurtain.IsSelected = false; |
| | | // }; |
| | | // btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | // btnCloseCurtain.IsSelected = false; |
| | | // btnOpenCurtain.IsSelected = true; |
| | | // btnStopCurtain.IsSelected = false; |
| | | // }; |
| | | // btnStopCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | // btnCloseCurtain.IsSelected = false; |
| | | // btnOpenCurtain.IsSelected = false; |
| | | // btnStopCurtain.IsSelected = true; |
| | | // }; |
| | | // if (device.DataStrings == "0") { |
| | | // btnStopCurtain.IsSelected = true; |
| | | // } else if (device.DataStrings == "1") { |
| | | // btnOpenCurtain.IsSelected = true; |
| | | // } else if (device.DataStrings == "2") { |
| | | // btnCloseCurtain.IsSelected = true; |
| | | // } |
| | | |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | if (btnStopCurtain.IsSelected) { |
| | | device.DataStrings = "0"; |
| | | } else if (btnOpenCurtain.IsSelected) { |
| | | device.DataStrings = "1"; |
| | | } else if (btnCloseCurtain.IsSelected) { |
| | | device.DataStrings = "2"; |
| | | } |
| | | dialog.Close (); |
| | | }; |
| | | #endregion |
| | | } else if (deviceType == DeviceType.CurtainTrietex.ToString () || deviceType == DeviceType.CurtainRoller.ToString ()) { |
| | | #region CurtainTrietexlView |
| | | var tempSeekBarFrame = new FrameLayout () { |
| | | Width = Application.GetRealWidth (520 - 150), |
| | | Height = Application.GetRealHeight (80), |
| | | X = Application.GetRealWidth (20), |
| | | Y = titleView.Bottom + Application.GetRealHeight (10), |
| | | }; |
| | | dialogBodyLayout.AddChidren (tempSeekBarFrame); |
| | | var horizontalSeekBar = new HorizontalSeekBar () { |
| | | Tag = DateTime.MinValue, |
| | | ThumbColor = SkinStyle.Current.ThumbColor2, |
| | | }; |
| | | tempSeekBarFrame.AddChidren (horizontalSeekBar); |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // if (btnStopCurtain.IsSelected) { |
| | | // device.DataStrings = "0"; |
| | | // } else if (btnOpenCurtain.IsSelected) { |
| | | // device.DataStrings = "1"; |
| | | // } else if (btnCloseCurtain.IsSelected) { |
| | | // device.DataStrings = "2"; |
| | | // } |
| | | // dialog.Close (); |
| | | // }; |
| | | // #endregion |
| | | // } else if (deviceType == DeviceType.CurtainTrietex.ToString () || deviceType == DeviceType.CurtainRoller.ToString ()) { |
| | | // #region CurtainTrietexlView |
| | | // var tempSeekBarFrame = new FrameLayout () { |
| | | // Width = Application.GetRealWidth (520 - 150), |
| | | // Height = Application.GetRealHeight (80), |
| | | // X = Application.GetRealWidth (20), |
| | | // Y = titleView.Bottom + Application.GetRealHeight (10), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (tempSeekBarFrame); |
| | | // var horizontalSeekBar = new HorizontalSeekBar () { |
| | | // Tag = DateTime.MinValue, |
| | | // ThumbColor = SkinStyle.Current.ThumbColor2, |
| | | // }; |
| | | // tempSeekBarFrame.AddChidren (horizontalSeekBar); |
| | | |
| | | Button btnMaxBrightness = new Button () { |
| | | Width = Application.GetRealWidth (90), |
| | | Height = Application.GetRealHeight (80), |
| | | X = tempSeekBarFrame.Right + Application.GetRealWidth (10), |
| | | Y = tempSeekBarFrame.Y, |
| | | Text = Convert.ToInt32 (device.DataStrings) - 3 + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | DateTime controlDateTime = DateTime.MinValue; |
| | | horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | controlDateTime = DateTime.Now; |
| | | btnMaxBrightness.Text = horizontalSeekBar.Progress.ToString () + "%"; |
| | | }; |
| | | // Button btnMaxBrightness = new Button () { |
| | | // Width = Application.GetRealWidth (90), |
| | | // Height = Application.GetRealHeight (80), |
| | | // X = tempSeekBarFrame.Right + Application.GetRealWidth (10), |
| | | // Y = tempSeekBarFrame.Y, |
| | | // Text = Convert.ToInt32 (device.DataStrings) - 3 + "%", |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | // DateTime controlDateTime = DateTime.MinValue; |
| | | // horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | // controlDateTime = DateTime.Now; |
| | | // btnMaxBrightness.Text = horizontalSeekBar.Progress.ToString () + "%"; |
| | | // }; |
| | | |
| | | Button btnOpenCurtain = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (125), |
| | | UnSelectedImagePath = "Curtain/CurtainOpen.png", |
| | | SelectedImagePath = "Curtain/CurtainOpenSelected.png", |
| | | X = Application.GetRealWidth (20), |
| | | Y = tempSeekBarFrame.Bottom + Application.GetRealHeight (40), |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOpenCurtain); |
| | | btnOpenCurtain.MouseUpEventHandler += (sender, e) => { |
| | | btnMaxBrightness.Text = "100%"; |
| | | horizontalSeekBar.Progress = 100; |
| | | }; |
| | | Button btnOpenLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | | X = btnOpenCurtain.X, |
| | | Y = btnOpenCurtain.Bottom + Application.GetRealHeight (5), |
| | | TextID = R.MyInternationalizationString.Open, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOpenLbl); |
| | | // Button btnOpenCurtain = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (125), |
| | | // UnSelectedImagePath = "Curtain/CurtainOpen.png", |
| | | // SelectedImagePath = "Curtain/CurtainOpenSelected.png", |
| | | // X = Application.GetRealWidth (20), |
| | | // Y = tempSeekBarFrame.Bottom + Application.GetRealHeight (40), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOpenCurtain); |
| | | // btnOpenCurtain.MouseUpEventHandler += (sender, e) => { |
| | | // btnMaxBrightness.Text = "100%"; |
| | | // horizontalSeekBar.Progress = 100; |
| | | // }; |
| | | // Button btnOpenLbl = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (30), |
| | | // X = btnOpenCurtain.X, |
| | | // Y = btnOpenCurtain.Bottom + Application.GetRealHeight (5), |
| | | // TextID = R.MyInternationalizationString.Open, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnOpenLbl); |
| | | |
| | | Button btnCloseCurtain = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (125), |
| | | X = Application.GetRealWidth (480 - 124 - 35), |
| | | Y = btnOpenCurtain.Y, |
| | | UnSelectedImagePath = "Curtain/CurtainClose.png", |
| | | SelectedImagePath = "Curtain/CurtainCloseSelected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseCurtain); |
| | | Button btnCloseLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | | X = btnCloseCurtain.X, |
| | | Y = btnOpenLbl.Y, |
| | | TextID = R.MyInternationalizationString.Close, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseLbl); |
| | | btnCloseCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = true; |
| | | btnOpenCurtain.IsSelected = false; |
| | | horizontalSeekBar.Progress = 0; |
| | | btnMaxBrightness.Text = "0%"; |
| | | }; |
| | | btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = true; |
| | | horizontalSeekBar.Progress = 100; |
| | | btnMaxBrightness.Text = "100%"; |
| | | }; |
| | | if (device.DataStrings == "1") { |
| | | btnOpenCurtain.IsSelected = true; |
| | | } else if (device.DataStrings == "2") { |
| | | btnCloseCurtain.IsSelected = true; |
| | | } |
| | | // Button btnCloseCurtain = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (125), |
| | | // X = Application.GetRealWidth (480 - 124 - 35), |
| | | // Y = btnOpenCurtain.Y, |
| | | // UnSelectedImagePath = "Curtain/CurtainClose.png", |
| | | // SelectedImagePath = "Curtain/CurtainCloseSelected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnCloseCurtain); |
| | | // Button btnCloseLbl = new Button () { |
| | | // Width = Application.GetRealWidth (124), |
| | | // Height = Application.GetRealHeight (30), |
| | | // X = btnCloseCurtain.X, |
| | | // Y = btnOpenLbl.Y, |
| | | // TextID = R.MyInternationalizationString.Close, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnCloseLbl); |
| | | // btnCloseCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | // btnCloseCurtain.IsSelected = true; |
| | | // btnOpenCurtain.IsSelected = false; |
| | | // horizontalSeekBar.Progress = 0; |
| | | // btnMaxBrightness.Text = "0%"; |
| | | // }; |
| | | // btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | // btnCloseCurtain.IsSelected = false; |
| | | // btnOpenCurtain.IsSelected = true; |
| | | // horizontalSeekBar.Progress = 100; |
| | | // btnMaxBrightness.Text = "100%"; |
| | | // }; |
| | | // if (device.DataStrings == "1") { |
| | | // btnOpenCurtain.IsSelected = true; |
| | | // } else if (device.DataStrings == "2") { |
| | | // btnCloseCurtain.IsSelected = true; |
| | | // } |
| | | |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | device.DataStrings = (horizontalSeekBar.Progress + 3).ToString (); |
| | | dialog.Close (); |
| | | }; |
| | | #endregion |
| | | } |
| | | } else if (deviceType == DeviceType.HVAC.ToString () || deviceType == DeviceType.ACInfrared.ToString ()) { |
| | | #region View |
| | | var power = device.DataStrings.Split (",") [0]; |
| | | var tempType = device.DataStrings.Split (",") [1]; |
| | | var mode = device.DataStrings.Split (",") [2]; |
| | | var windSpeed = device.DataStrings.Split (",") [3]; |
| | | var temp = device.DataStrings.Split (",") [4]; |
| | | var btnSetTemperature = new Button () { |
| | | X = Application.GetRealWidth (35), |
| | | Y = Application.GetRealHeight (85), |
| | | Width = Application.GetRealHeight (410), |
| | | Height = Application.GetRealHeight (50), |
| | | Text = Language.StringByID (R.MyInternationalizationString.SetTemperature).Replace ("--", temp), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | Enable = false, |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnSetTemperature); |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // device.DataStrings = (horizontalSeekBar.Progress + 3).ToString (); |
| | | // dialog.Close (); |
| | | // }; |
| | | // #endregion |
| | | // } |
| | | // } else if (deviceType == DeviceType.HVAC.ToString () || deviceType == DeviceType.ACInfrared.ToString ()) { |
| | | // #region View |
| | | // var power = device.DataStrings.Split (",") [0]; |
| | | // var tempType = device.DataStrings.Split (",") [1]; |
| | | // var mode = device.DataStrings.Split (",") [2]; |
| | | // var windSpeed = device.DataStrings.Split (",") [3]; |
| | | // var temp = device.DataStrings.Split (",") [4]; |
| | | // var btnSetTemperature = new Button () { |
| | | // X = Application.GetRealWidth (35), |
| | | // Y = Application.GetRealHeight (85), |
| | | // Width = Application.GetRealHeight (410), |
| | | // Height = Application.GetRealHeight (50), |
| | | // Text = Language.StringByID (R.MyInternationalizationString.SetTemperature).Replace ("--", temp), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // Enable = false, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnSetTemperature); |
| | | |
| | | Button btnReduceTemperature = new Button () { |
| | | Width = Application.GetRealWidth (94), |
| | | Height = Application.GetRealHeight (94), |
| | | X = Application.GetRealWidth (20), |
| | | Y = btnSetTemperature.Bottom + Application.GetRealHeight (20), |
| | | UnSelectedImagePath = "AC/AC-.png", |
| | | SelectedImagePath = "AC/AC-Selected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnReduceTemperature); |
| | | // Button btnReduceTemperature = new Button () { |
| | | // Width = Application.GetRealWidth (94), |
| | | // Height = Application.GetRealHeight (94), |
| | | // X = Application.GetRealWidth (20), |
| | | // Y = btnSetTemperature.Bottom + Application.GetRealHeight (20), |
| | | // UnSelectedImagePath = "AC/AC-.png", |
| | | // SelectedImagePath = "AC/AC-Selected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnReduceTemperature); |
| | | |
| | | Button btnSwitchAC = new Button () { |
| | | Width = Application.GetRealWidth (94), |
| | | Height = Application.GetRealHeight (94), |
| | | X = Application.GetRealWidth ((480 - 94) / 2), |
| | | Y = btnReduceTemperature.Y, |
| | | UnSelectedImagePath = "AC/ACClose.png", |
| | | SelectedImagePath = "AC/ACCloseSelected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnSwitchAC); |
| | | btnSwitchAC.MouseUpEventHandler += (sender, e) => { |
| | | btnSwitchAC.IsSelected = !btnSwitchAC.IsSelected; |
| | | power = btnSwitchAC.IsSelected == true?"1":"0"; |
| | | }; |
| | | btnSwitchAC.IsSelected = power == "1"; |
| | | // Button btnSwitchAC = new Button () { |
| | | // Width = Application.GetRealWidth (94), |
| | | // Height = Application.GetRealHeight (94), |
| | | // X = Application.GetRealWidth ((480 - 94) / 2), |
| | | // Y = btnReduceTemperature.Y, |
| | | // UnSelectedImagePath = "AC/ACClose.png", |
| | | // SelectedImagePath = "AC/ACCloseSelected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnSwitchAC); |
| | | // btnSwitchAC.MouseUpEventHandler += (sender, e) => { |
| | | // btnSwitchAC.IsSelected = !btnSwitchAC.IsSelected; |
| | | // power = btnSwitchAC.IsSelected == true?"1":"0"; |
| | | // }; |
| | | // btnSwitchAC.IsSelected = power == "1"; |
| | | |
| | | Button btnAddTemperature = new Button () { |
| | | Width = Application.GetRealWidth (94), |
| | | Height = Application.GetRealHeight (94), |
| | | X = Application.GetRealWidth (480 - 20 - 94), |
| | | Y = btnReduceTemperature.Y, |
| | | UnSelectedImagePath = "AC/AC+.png", |
| | | SelectedImagePath = "AC/AC+Selected.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnAddTemperature); |
| | | btnReduceTemperature.MouseDownEventHandler += (sender, e) => { |
| | | btnReduceTemperature.IsSelected = true; |
| | | }; |
| | | btnReduceTemperature.MouseUpEventHandler += (sender, e) => { |
| | | btnReduceTemperature.IsSelected = false; |
| | | if (Convert.ToInt32 (temp) > 0) |
| | | temp = (Convert.ToInt32 (temp) - 1).ToString (); |
| | | }; |
| | | btnAddTemperature.MouseDownEventHandler += (sender, e) => { |
| | | btnAddTemperature.IsSelected = true; |
| | | }; |
| | | btnAddTemperature.MouseUpEventHandler += (sender, e) => { |
| | | btnAddTemperature.IsSelected = false; |
| | | btnReduceTemperature.IsSelected = false; |
| | | if (Convert.ToInt32 (temp) < 30) |
| | | temp = (Convert.ToInt32 (temp) + 1).ToString (); |
| | | }; |
| | | #endregion |
| | | // Button btnAddTemperature = new Button () { |
| | | // Width = Application.GetRealWidth (94), |
| | | // Height = Application.GetRealHeight (94), |
| | | // X = Application.GetRealWidth (480 - 20 - 94), |
| | | // Y = btnReduceTemperature.Y, |
| | | // UnSelectedImagePath = "AC/AC+.png", |
| | | // SelectedImagePath = "AC/AC+Selected.png", |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (btnAddTemperature); |
| | | // btnReduceTemperature.MouseDownEventHandler += (sender, e) => { |
| | | // btnReduceTemperature.IsSelected = true; |
| | | // }; |
| | | // btnReduceTemperature.MouseUpEventHandler += (sender, e) => { |
| | | // btnReduceTemperature.IsSelected = false; |
| | | // if (Convert.ToInt32 (temp) > 0) |
| | | // temp = (Convert.ToInt32 (temp) - 1).ToString (); |
| | | // }; |
| | | // btnAddTemperature.MouseDownEventHandler += (sender, e) => { |
| | | // btnAddTemperature.IsSelected = true; |
| | | // }; |
| | | // btnAddTemperature.MouseUpEventHandler += (sender, e) => { |
| | | // btnAddTemperature.IsSelected = false; |
| | | // btnReduceTemperature.IsSelected = false; |
| | | // if (Convert.ToInt32 (temp) < 30) |
| | | // temp = (Convert.ToInt32 (temp) + 1).ToString (); |
| | | // }; |
| | | // #endregion |
| | | |
| | | #region ModeView |
| | | FrameLayout acModeView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (97), |
| | | Width = LayoutParams.MatchParent, |
| | | Y = btnReduceTemperature.Bottom + Application.GetRealHeight (7), |
| | | }; |
| | | dialogBodyLayout.AddChidren (acModeView); |
| | | // #region ModeView |
| | | // FrameLayout acModeView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (97), |
| | | // Width = LayoutParams.MatchParent, |
| | | // Y = btnReduceTemperature.Bottom + Application.GetRealHeight (7), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (acModeView); |
| | | |
| | | Button btnACModeLeft = new Button () { |
| | | Width = Application.GetRealWidth (129), |
| | | Height = Application.GetRealHeight (129), |
| | | X = btnReduceTemperature.X - Application.GetRealWidth (17), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "AC/ACLeft.png", |
| | | SelectedImagePath = "AC/ACLeft.png", |
| | | }; |
| | | acModeView.AddChidren (btnACModeLeft); |
| | | // Button btnACModeLeft = new Button () { |
| | | // Width = Application.GetRealWidth (129), |
| | | // Height = Application.GetRealHeight (129), |
| | | // X = btnReduceTemperature.X - Application.GetRealWidth (17), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // UnSelectedImagePath = "AC/ACLeft.png", |
| | | // SelectedImagePath = "AC/ACLeft.png", |
| | | // }; |
| | | // acModeView.AddChidren (btnACModeLeft); |
| | | |
| | | Button btnModeIcon = new Button () { |
| | | Width = Application.GetRealWidth (105), |
| | | Height = Application.GetRealHeight (105), |
| | | Gravity = Gravity.Center, |
| | | Enable = false, |
| | | }; |
| | | acModeView.AddChidren (btnModeIcon); |
| | | // Button btnModeIcon = new Button () { |
| | | // Width = Application.GetRealWidth (105), |
| | | // Height = Application.GetRealHeight (105), |
| | | // Gravity = Gravity.Center, |
| | | // Enable = false, |
| | | // }; |
| | | // acModeView.AddChidren (btnModeIcon); |
| | | |
| | | switch (mode) { |
| | | case "0": |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | break; |
| | | case "1": |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | break; |
| | | case "2": |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | break; |
| | | case "3": |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | case "4": |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | break; |
| | | } |
| | | // switch (mode) { |
| | | // case "0": |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | // break; |
| | | // case "1": |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | // break; |
| | | // case "2": |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | // break; |
| | | // case "3": |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // case "4": |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | // break; |
| | | // } |
| | | |
| | | Button btnACModeRight = new Button () { |
| | | Width = Application.GetRealWidth (129), |
| | | Height = Application.GetRealHeight (129), |
| | | X = btnAddTemperature.X - Application.GetRealWidth (17), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "AC/ACRight.png", |
| | | SelectedImagePath = "AC/ACRightSelected.png", |
| | | }; |
| | | acModeView.AddChidren (btnACModeRight); |
| | | btnACModeRight.MouseDownEventHandler += (sender, e) => { |
| | | btnACModeRight.IsSelected = true; |
| | | }; |
| | | btnACModeRight.MouseUpEventHandler += (sender, e) => { |
| | | btnACModeRight.IsSelected = false; |
| | | switch (mode) { |
| | | case "0": |
| | | mode = "1"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | break; |
| | | case "1": |
| | | mode = "2"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | break; |
| | | case "2": |
| | | mode = "3"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | case "3": |
| | | mode = "4"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | break; |
| | | case "4": |
| | | mode = "0"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | break; |
| | | } |
| | | // Button btnACModeRight = new Button () { |
| | | // Width = Application.GetRealWidth (129), |
| | | // Height = Application.GetRealHeight (129), |
| | | // X = btnAddTemperature.X - Application.GetRealWidth (17), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // UnSelectedImagePath = "AC/ACRight.png", |
| | | // SelectedImagePath = "AC/ACRightSelected.png", |
| | | // }; |
| | | // acModeView.AddChidren (btnACModeRight); |
| | | // btnACModeRight.MouseDownEventHandler += (sender, e) => { |
| | | // btnACModeRight.IsSelected = true; |
| | | // }; |
| | | // btnACModeRight.MouseUpEventHandler += (sender, e) => { |
| | | // btnACModeRight.IsSelected = false; |
| | | // switch (mode) { |
| | | // case "0": |
| | | // mode = "1"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | // break; |
| | | // case "1": |
| | | // mode = "2"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | // break; |
| | | // case "2": |
| | | // mode = "3"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // case "3": |
| | | // mode = "4"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | // break; |
| | | // case "4": |
| | | // mode = "0"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | // break; |
| | | // } |
| | | |
| | | }; |
| | | btnACModeLeft.MouseDownEventHandler += (sender, e) => { |
| | | btnACModeLeft.IsSelected = true; |
| | | }; |
| | | btnACModeLeft.MouseUpEventHandler += (sender, e) => { |
| | | btnACModeLeft.IsSelected = false; |
| | | switch (mode) { |
| | | case "0": |
| | | mode = "4"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | break; |
| | | case "1": |
| | | mode = "0"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | break; |
| | | case "2": |
| | | mode = "1"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | break; |
| | | case "3": |
| | | mode = "2"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | break; |
| | | case "4": |
| | | mode = "3"; |
| | | btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | } |
| | | }; |
| | | #endregion |
| | | // }; |
| | | // btnACModeLeft.MouseDownEventHandler += (sender, e) => { |
| | | // btnACModeLeft.IsSelected = true; |
| | | // }; |
| | | // btnACModeLeft.MouseUpEventHandler += (sender, e) => { |
| | | // btnACModeLeft.IsSelected = false; |
| | | // switch (mode) { |
| | | // case "0": |
| | | // mode = "4"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACDehumidification.png"; |
| | | // break; |
| | | // case "1": |
| | | // mode = "0"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACRefrigeration.png"; |
| | | // break; |
| | | // case "2": |
| | | // mode = "1"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACHeating.png"; |
| | | // break; |
| | | // case "3": |
| | | // mode = "2"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACModeAuto.png"; |
| | | // break; |
| | | // case "4": |
| | | // mode = "3"; |
| | | // btnModeIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // } |
| | | // }; |
| | | // #endregion |
| | | |
| | | #region WindView |
| | | FrameLayout acWindView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (97), |
| | | Width = LayoutParams.MatchParent, |
| | | Y = acModeView.Bottom + Application.GetRealHeight (1), |
| | | }; |
| | | dialogBodyLayout.AddChidren (acWindView); |
| | | // #region WindView |
| | | // FrameLayout acWindView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (97), |
| | | // Width = LayoutParams.MatchParent, |
| | | // Y = acModeView.Bottom + Application.GetRealHeight (1), |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (acWindView); |
| | | |
| | | Button btnACWindLeft = new Button () { |
| | | Width = Application.GetRealWidth (129), |
| | | Height = Application.GetRealHeight (129), |
| | | X = btnReduceTemperature.X - Application.GetRealWidth (17), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "AC/ACLeft.png", |
| | | SelectedImagePath = "AC/ACLeft.png", |
| | | }; |
| | | acWindView.AddChidren (btnACWindLeft); |
| | | // Button btnACWindLeft = new Button () { |
| | | // Width = Application.GetRealWidth (129), |
| | | // Height = Application.GetRealHeight (129), |
| | | // X = btnReduceTemperature.X - Application.GetRealWidth (17), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // UnSelectedImagePath = "AC/ACLeft.png", |
| | | // SelectedImagePath = "AC/ACLeft.png", |
| | | // }; |
| | | // acWindView.AddChidren (btnACWindLeft); |
| | | |
| | | Button btnWindIcon = new Button () { |
| | | Width = Application.GetRealWidth (105), |
| | | Height = Application.GetRealHeight (105), |
| | | Gravity = Gravity.Center, |
| | | Enable = false, |
| | | }; |
| | | acWindView.AddChidren (btnWindIcon); |
| | | switch (windSpeed) { |
| | | case "0": |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | case "3": |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | break; |
| | | case "2": |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | break; |
| | | case "1": |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | break; |
| | | } |
| | | Button btnACWindRight = new Button () { |
| | | Width = Application.GetRealWidth (129), |
| | | Height = Application.GetRealHeight (129), |
| | | X = btnAddTemperature.X - Application.GetRealWidth (17), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "AC/ACRight.png", |
| | | SelectedImagePath = "AC/ACRightSelected.png", |
| | | }; |
| | | btnACWindLeft.MouseDownEventHandler += (sender, e) => { |
| | | btnACWindLeft.IsSelected = true; |
| | | }; |
| | | btnACWindLeft.MouseUpEventHandler += (sender, e) => { |
| | | btnACWindLeft.IsSelected = false; |
| | | switch (windSpeed) { |
| | | case "0": |
| | | windSpeed = "3"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | break; |
| | | case "3": |
| | | windSpeed = "2"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | break; |
| | | case "2": |
| | | windSpeed = "1"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | break; |
| | | case "1": |
| | | windSpeed = "0"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | } |
| | | }; |
| | | acWindView.AddChidren (btnACWindRight); |
| | | btnACWindRight.MouseDownEventHandler += (sender, e) => { |
| | | btnACWindRight.IsSelected = true; |
| | | }; |
| | | btnACWindRight.MouseUpEventHandler += (sender, e) => { |
| | | btnACWindRight.IsSelected = false; |
| | | switch (windSpeed) { |
| | | case "0": |
| | | windSpeed = "1"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | break; |
| | | case "3": |
| | | windSpeed = "0"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | break; |
| | | case "2": |
| | | windSpeed = "3"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | break; |
| | | case "1": |
| | | windSpeed = "2"; |
| | | btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | break; |
| | | } |
| | | }; |
| | | #endregion |
| | | // Button btnWindIcon = new Button () { |
| | | // Width = Application.GetRealWidth (105), |
| | | // Height = Application.GetRealHeight (105), |
| | | // Gravity = Gravity.Center, |
| | | // Enable = false, |
| | | // }; |
| | | // acWindView.AddChidren (btnWindIcon); |
| | | // switch (windSpeed) { |
| | | // case "0": |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // case "3": |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | // break; |
| | | // case "2": |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | // break; |
| | | // case "1": |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | // break; |
| | | // } |
| | | // Button btnACWindRight = new Button () { |
| | | // Width = Application.GetRealWidth (129), |
| | | // Height = Application.GetRealHeight (129), |
| | | // X = btnAddTemperature.X - Application.GetRealWidth (17), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // UnSelectedImagePath = "AC/ACRight.png", |
| | | // SelectedImagePath = "AC/ACRightSelected.png", |
| | | // }; |
| | | // btnACWindLeft.MouseDownEventHandler += (sender, e) => { |
| | | // btnACWindLeft.IsSelected = true; |
| | | // }; |
| | | // btnACWindLeft.MouseUpEventHandler += (sender, e) => { |
| | | // btnACWindLeft.IsSelected = false; |
| | | // switch (windSpeed) { |
| | | // case "0": |
| | | // windSpeed = "3"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | // break; |
| | | // case "3": |
| | | // windSpeed = "2"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | // break; |
| | | // case "2": |
| | | // windSpeed = "1"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | // break; |
| | | // case "1": |
| | | // windSpeed = "0"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // } |
| | | // }; |
| | | // acWindView.AddChidren (btnACWindRight); |
| | | // btnACWindRight.MouseDownEventHandler += (sender, e) => { |
| | | // btnACWindRight.IsSelected = true; |
| | | // }; |
| | | // btnACWindRight.MouseUpEventHandler += (sender, e) => { |
| | | // btnACWindRight.IsSelected = false; |
| | | // switch (windSpeed) { |
| | | // case "0": |
| | | // windSpeed = "1"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACHighWind.png"; |
| | | // break; |
| | | // case "3": |
| | | // windSpeed = "0"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACAuto.png"; |
| | | // break; |
| | | // case "2": |
| | | // windSpeed = "3"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACLowWind.png"; |
| | | // break; |
| | | // case "1": |
| | | // windSpeed = "2"; |
| | | // btnWindIcon.UnSelectedImagePath = "AC/ACStroke.png"; |
| | | // break; |
| | | // } |
| | | // }; |
| | | // #endregion |
| | | |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | device.DataStrings = power + "," + tempType + "," + mode + "," + windSpeed + "," + temp; |
| | | dialog.Close (); |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // device.DataStrings = power + "," + tempType + "," + mode + "," + windSpeed + "," + temp; |
| | | // dialog.Close (); |
| | | |
| | | }; |
| | | } else if (deviceType == DeviceType.FoolHeat.ToString () || deviceType == DeviceType.FoolHeatPanel.ToString ()) { |
| | | // }; |
| | | // } else if (deviceType == DeviceType.FoolHeat.ToString () || deviceType == DeviceType.FoolHeatPanel.ToString ()) { |
| | | |
| | | } else if (deviceType == DeviceType.DryContact.ToString ()) { |
| | | // } else if (deviceType == DeviceType.DryContact.ToString ()) { |
| | | |
| | | } else if (deviceType == DeviceType.MusicModel.ToString ()) { |
| | | // } else if (deviceType == DeviceType.MusicModel.ToString ()) { |
| | | |
| | | } else if (deviceType == DeviceType.FanModule.ToString ()) { |
| | | // } else if (deviceType == DeviceType.FanModule.ToString ()) { |
| | | |
| | | } else if (deviceType == DeviceType.UniversalDevice.ToString ()) { |
| | | #region UniversalDevice |
| | | var windBodyView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (400), |
| | | Y = titleView.Bottom, |
| | | }; |
| | | dialogBodyLayout.AddChidren (windBodyView); |
| | | // } else if (deviceType == DeviceType.UniversalDevice.ToString ()) { |
| | | // #region UniversalDevice |
| | | // var windBodyView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (400), |
| | | // Y = titleView.Bottom, |
| | | // }; |
| | | // dialogBodyLayout.AddChidren (windBodyView); |
| | | |
| | | Button tempSiwtch = new Button () { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight (100), |
| | | Width = Application.GetRealWidth (110), |
| | | Height = Application.GetRealHeight (70), |
| | | Radius = 2, |
| | | BorderColor = SkinStyle.Current.White20Transparent, |
| | | BorderWidth = 2, |
| | | TextID = device.DataStrings == "255" ? R.MyInternationalizationString.ON : R.MyInternationalizationString.OFF, |
| | | BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | IsSelected = device.DataStrings == "255" |
| | | }; |
| | | windBodyView.AddChidren (tempSiwtch); |
| | | // Button tempSiwtch = new Button () { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight (100), |
| | | // Width = Application.GetRealWidth (110), |
| | | // Height = Application.GetRealHeight (70), |
| | | // Radius = 2, |
| | | // BorderColor = SkinStyle.Current.White20Transparent, |
| | | // BorderWidth = 2, |
| | | // TextID = device.DataStrings == "255" ? R.MyInternationalizationString.ON : R.MyInternationalizationString.OFF, |
| | | // BackgroundColor = SkinStyle.Current.ButtonColor, |
| | | // SelectedBackgroundColor = SkinStyle.Current.SelectedColor, |
| | | // IsSelected = device.DataStrings == "255" |
| | | // }; |
| | | // windBodyView.AddChidren (tempSiwtch); |
| | | |
| | | tempSiwtch.MouseUpEventHandler += (sender3, e3) => { |
| | | tempSiwtch.IsSelected = !tempSiwtch.IsSelected; |
| | | if (tempSiwtch.IsSelected) { |
| | | tempSiwtch.TextID = R.MyInternationalizationString.ON; |
| | | } else { |
| | | tempSiwtch.TextID = R.MyInternationalizationString.OFF; |
| | | } |
| | | }; |
| | | // tempSiwtch.MouseUpEventHandler += (sender3, e3) => { |
| | | // tempSiwtch.IsSelected = !tempSiwtch.IsSelected; |
| | | // if (tempSiwtch.IsSelected) { |
| | | // tempSiwtch.TextID = R.MyInternationalizationString.ON; |
| | | // } else { |
| | | // tempSiwtch.TextID = R.MyInternationalizationString.OFF; |
| | | // } |
| | | // }; |
| | | |
| | | btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | if (tempSiwtch.IsSelected) { |
| | | device.DataStrings = "255"; |
| | | } else { |
| | | device.DataStrings = "0"; |
| | | } |
| | | dialog.Close (); |
| | | }; |
| | | #endregion |
| | | } |
| | | dialog.Show (); |
| | | } |
| | | // btnSave.MouseUpEventHandler += (sender2, e2) => { |
| | | // if (tempSiwtch.IsSelected) { |
| | | // device.DataStrings = "255"; |
| | | // } else { |
| | | // device.DataStrings = "0"; |
| | | // } |
| | | // dialog.Close (); |
| | | // }; |
| | | // #endregion |
| | | // } |
| | | // dialog.Show (); |
| | | // } |
| | | |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |