| | |
| | | List<Function> functionList; |
| | | int titleId; |
| | | |
| | | public Action DelAction; |
| | | public FunctionPage() |
| | | { |
| | | bodyView = this; |
| | |
| | | } |
| | | else if (titleId == StringId.Electric) |
| | | { |
| | | |
| | | functionList.AddRange(FunctionList.List.GetElectricals()); |
| | | |
| | | } |
| | | else if (titleId == StringId.EnvironmentalScience) |
| | | { |
| | |
| | | else if (titleId == StringId.SecurityMonitoring) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetIpCamImouList()); |
| | | } |
| | | else if(titleId == StringId.EnergyMonitoring) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetEnergyList()); |
| | | } |
| | | functionList = functionList.OrderByDescending(o => o.controlCounter).ToList(); |
| | | |
| | |
| | | functionListView.AddChidren(functionDiv); |
| | | |
| | | } |
| | | else if (function.spk == SPK.ElectricalTvHisense) |
| | | { |
| | | Action deviceDelAction = () => |
| | | { |
| | | //删除设备成功后更新UI |
| | | if (functionListView==null) { |
| | | return; |
| | | } |
| | | functionListView.RemoveAll(); |
| | | showList.Remove(function);//先移除 |
| | | ShowFunctionRow(showList,isAppend); |
| | | this.DelAction?.Invoke(); |
| | | |
| | | }; |
| | | var functionDiv = new FunctionControlZone(function, deviceDelAction) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(96), |
| | | Radius = (uint)Application.GetMinRealAverage(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = function.spk + function.sid |
| | | }; |
| | | functionDiv.LoadFunctionDiv(); |
| | | functionDiv.OrderEvent = OrderEvent; |
| | | functionListView.AddChidren(functionDiv); |
| | | } |
| | | else |
| | | { |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | var functionDiv = new FunctionControlZone(function, null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |