| | |
| | | #endregion |
| | | |
| | | List<Function> functionList; |
| | | int titleId; |
| | | |
| | | public FunctionPage() |
| | | { |
| | | bodyView = this; |
| | | functionList = new List<Function>(); |
| | | |
| | | } |
| | | |
| | | public void LoadPage(int titleId) |
| | | public void LoadPage(int titleId_out) |
| | | { |
| | | this.titleId = titleId_out; |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | if (titleId == StringId.Lights) |
| | | if (titleId == StringId.Lights && !DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | Action action = () => |
| | | { |
| | |
| | | |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | functionList.AddRange(FunctionList.List.groupControls); |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene); |
| | | |
| | | foreach (var scene in lightScene) |
| | | { |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | |
| | | var sceneRow = new SceneControlZone(scene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | } |
| | | |
| | | |
| | | } |
| | | else if (titleId == StringId.AC) |
| | |
| | | LoadDialog_ChangeFloor(); |
| | | |
| | | |
| | | #region 加载组合调光场景 |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | foreach (var lightScene in FunctionList.List.scenes) |
| | | { |
| | | if (lightScene.sceneType == SceneType.LightScene) |
| | | if (lightScene != null) |
| | | { |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | var sceneRow = new SceneControlZone(lightScene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 显示的设备的总数 |
| | | /// </summary> |
| | | int showCount = 0; |
| | | int showCount = -1; |
| | | /// <summary> |
| | | /// 加载功能row |
| | | /// </summary> |
| | |
| | | { |
| | | if (!isAppend) |
| | | { |
| | | showCount = 0; |
| | | showCount = -1; |
| | | functionListView.RemoveAll(); |
| | | #region 加载组合调光场景 |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | foreach (var lightScene in FunctionList.List.scenes) |
| | | { |
| | | if (lightScene.sceneType == SceneType.LightScene) |
| | | if (lightScene != null) |
| | | { |
| | | var sceneRow = new SceneControlZone(lightScene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | int i = 0; |
| | | foreach (var function in showList) |
| | | for (var i = 0;i<50;i++) |
| | | //foreach (var function in showList) |
| | | { |
| | | i++; |
| | | if (i > 50) |
| | | showCount++; |
| | | if (showCount >= showList.Count) |
| | | { |
| | | break; |
| | | } |
| | | showCount++; |
| | | var function = showList[showCount]; |
| | | |
| | | if (function.spk == SPK.SensorDryContact || function.spk == SPK.SensorDryContact2) |
| | | { |
| | |
| | | Tag = function.spk + function.sid |
| | | }; |
| | | functionDiv.LoadFunctionDiv(); |
| | | functionDiv.OrderEvent = OrderEvent; |
| | | functionListView.AddChidren(functionDiv); |
| | | } |
| | | else if (function.spk == SPK.IpCam_Imou) |
| | |
| | | Tag = function.spk + function.sid |
| | | }; |
| | | functionDiv.LoadFunctionDiv(); |
| | | functionDiv.OrderEvent = OrderEvent; |
| | | functionListView.AddChidren(functionDiv); |
| | | } |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(10) }); |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "加载更多", |
| | | TextID = StringId.LoadMore, |
| | | }; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | btnAppend.Text = "Load more"; |
| | | } |
| | | functionListView.AddChidren(btnAppend); |
| | | btnAppend.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 排序事件 |
| | | /// </summary> |
| | | void OrderEvent() |
| | | { |
| | | Action action = () => |
| | | { |
| | | functionList = functionList.OrderBy(o => o.FunctionOrderNumber).ToList(); |
| | | ShowFunctionRow(functionList); |
| | | }; |
| | | var skipView = new OrderFunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(functionList, action); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 加载功能类型控制卡片 |