| | |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | RemoveAll(); |
| | | InitData(); |
| | | AddTop(); |
| | | AddBodyView(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | private void RefreshData() |
| | | { |
| | | devList = Shared.Common.Room.CurrentRoom.GetUnalloctedDeviceUIs(); |
| | | //sceneList = Shared.Common.Room.CurrentRoom.GetUnalloctedScenes(); |
| | | sceneList = Shared.Common.Room.CurrentRoom.GetLoveRoom().SceneUIList; |
| | | sceneList = Shared.Common.Room.CurrentRoom.GetUnalloctedScenes(); |
| | | typeDeviceDic.Clear(); |
| | | typeIdDic.Clear(); |
| | | if (devList == null) |
| | |
| | | } |
| | | foreach (var device in devList) |
| | | { |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device?.CommonDevice }); |
| | | var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device?.CommonDevice); |
| | | if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false) |
| | | { |
| | | var sameDevList = new List<DeviceUI> { }; |
| | |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void RefreshBodyView() |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | |
| | | |
| | | if (functionBtn.IsSelected) |
| | | { |
| | | ShowFunction(); |
| | |
| | | Width = Application.GetRealWidth(1028) |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeScrowView); |
| | | |
| | | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | |
| | | }; |
| | | string imgPath=string.Empty; |
| | | string imgSeletedPath=string.Empty; |
| | | Common.LocalDevice.Current.GetDeviceBeloneIcon(deviceType.Value, ref imgPath ,ref imgSeletedPath); |
| | | Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath ,ref imgSeletedPath); |
| | | functionTypeIMG.Init(imgPath,imgSeletedPath); |
| | | functionTypeIMG.SetTitle(deviceType.Key); |
| | | typeRowLayout.AddChidren(functionTypeIMG); |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | //选择功能--直接从房间的devicelist中获取 |
| | | tempFunctionTypeBtn.IsSelected = false; |
| | | tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton; |
| | | ((typeSender as Button).Parent as FunctionButton).IsSelected = true; |
| | |
| | | |
| | | var deviceRow = new SelectFunctionView(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI.CommonDevice)); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.Cancel; |
| | | selectedList.Clear(); |
| | | selectedList.AddRange(sameTypeList); |
| | | } |
| | | else |
| | |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | AddChidren(selectZone); |
| | | selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | selectZone.ZoneAction += (r) => |
| | | { |
| | | foreach (var d in selectedList) |
| | | { |
| | | r.AddDevice(d.CommonDevice, true); |
| | | deviceListScrolView.RemoveViewByTag(d); |
| | | } |
| | | RefreshData(); |
| | | |
| | | if (sameTypeList.Count == selectedList.Count) |
| | | { |
| | | RefreshData(); |
| | | RefreshBodyView(); |
| | | } |
| | | else |
| | | { |
| | | RefreshData(); |
| | | sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())]; |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | |
| | | ShowNoSceneTip(); |
| | | } |
| | | else |
| | | { |
| | | {
|
| | | var sceneScrolView = new VerticalScrolViewLayout |
| | | { |
| | | Y = Application.GetRealHeight(22), |
| | |
| | | var frame = sceneScrolView.GetChildren(i) as FrameLayout; |
| | | (frame.GetChildren(1) as Button).IsSelected = (sender as Button).IsSelected; |
| | | } |
| | | |
| | | |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.Cancel; |
| | |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | CommonPage.Instance.AddChidren(selectZone); |
| | | selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | selectZone.ZoneAction += (r) => |
| | | { |
| | | foreach (var s in selectedList) |
| | | { |