| | |
| | | using Shared.Common;
|
| | | using Shared.Phone.UserCenter.SmartSound;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
| | | public class DeviceListMainForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 智能音箱
|
| | | /// </summary>
|
| | | private MySmartSoundControl smmartSoundView = null;
|
| | | /// <summary>
|
| | | /// 网关控件
|
| | | /// </summary>
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | smmartSoundView = new MySmartSoundControl();
|
| | | bodyFrameLayout.AddChidren(smmartSoundView);
|
| | | smmartSoundView.InitControl();
|
| | | //当前不是虚拟住宅的话
|
| | | if (Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | smmartSoundView.ButtonClickEvent += (sernder, e) =>
|
| | | {
|
| | | var form = new SmartSoundListForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | | //初始化网关行控件
|
| | | GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
|
| | | var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
|
| | |
| | | //提示新版本
|
| | | var btnNew = new InformationTipView(rowMenu.btnIcon);
|
| | | btnNew.Visible = false;
|
| | | rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
|
| | | rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
|
| | | rowMenu.AddTag("btnNew", btnNew);
|
| | |
|
| | | //检测设备是否拥有定位的功能
|
| | |
| | | if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true)
|
| | | {
|
| | | //重新设置住宅ID(这个应该是不经过APP,直接把网关恢复了出厂设置)
|
| | | if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
|
| | | if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.HomeId) == true)
|
| | | {
|
| | | //显示进度条
|
| | | ProgressBar.Show();
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (HdlGatewayLogic.Current.GetGatewayId(gateWay) == this.gatewayViewRow.zbGatewayId)
|
| | | if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
|
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | |
| | | this.UseClickStatu = false;
|
| | | if (i_zbGateway != null)
|
| | | {
|
| | | this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
|
| | | this.zbGatewayId = i_zbGateway.GwId;
|
| | | }
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.Y = Application.GetRealHeight(174);
|
| | | this.Height = Application.GetRealHeight(173);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 自定义智能音箱控件_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自定义网关控件
|
| | | /// </summary>
|
| | | private class MySmartSoundControl : FrameRowControl
|
| | | {
|
| | |
|
| | | /// <summary>
|
| | | /// 网关名字控件
|
| | | /// </summary>
|
| | | private NormalViewControl btnName = null;
|
| | |
|
| | | /// <summary>
|
| | | /// 自定音箱关控件
|
| | | /// </summary>
|
| | | public MySmartSoundControl()
|
| | | {
|
| | | this.UseClickStatu = false;
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.Height = Application.GetRealHeight(173);
|
| | |
|
| | | //this.InitControl();
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | public void InitControl()
|
| | | {
|
| | | //图标
|
| | | var btnIcon = this.AddLeftIcon(81);
|
| | | btnIcon.UnSelectedImagePath = "SmartSound/SoundIcon.png";
|
| | |
|
| | | //显示文本
|
| | | btnName = this.AddLeftCaption(string.Empty, 700);
|
| | | btnName.Height = Application.GetRealHeight(60);
|
| | | btnName.TextSize = 15;
|
| | | btnName.Y = Application.GetRealHeight(57);
|
| | | btnName.Text = "小度小度";
|
| | |
|
| | | this.AddRightArrow();
|
| | | this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
|
| | | this.AddBottomLine();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|