陈嘉乐
2021-03-16 6b5f23413ceac72ad97d354e658798c8a422f556
2021-3-26-3

最新代码
2个文件已添加
8个文件已修改
776 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs 263 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/MainView.cs 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,39 +1,50 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Mqtt/MqttClient.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="504" Column="10" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="256" Column="72" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="341" Column="41" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="45" Column="19" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="223" Column="28" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="271" Column="71" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="109" Column="13" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="398" Column="46" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="141" Column="75" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="183" Column="76" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="262" Column="14" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="233" Column="78" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs" Line="98" Column="15" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs" Line="14" Column="54" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="264" Column="56" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="169" Column="26" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" Line="14" Column="40" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="304" Column="34" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="15" Column="13" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" Line="206" Column="34" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="400" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="Mqtt" expanded="True">
                  <Node name="MqttClient.cs" selected="True" />
                </Node>
                <Node name="Mqtt" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True" />
                    <Node name="PirDevice" expanded="True">
                      <Node name="DeviceSet.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True" />
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Assets" expanded="True">
                <Node name="Phone" expanded="True" />
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True">
                <Node name="Phone" expanded="True">
                  <Node name="PirIcon" expanded="True" />
                </Node>
              </Node>
            </Node>
          </Node>
        </State>
      </Pad>
HDL_ON/HDL_ON.projitems
@@ -363,6 +363,8 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FrameLayout50.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PirView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ControlView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\MainView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\HeigthChangeView.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)UI\" />
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -243,7 +243,6 @@
                                loading.Hide();
                                if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                                {
                                    ///这里:监听MTTP推送下来主题,才知道是否添加成功
                                    var buttonObj = control.status.Find((c) => c.value == obj.value);
                                    if (buttonObj != null)
                                    {
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
@@ -65,7 +65,7 @@
                TextAlignment = TextAlignment.Center,
            };
            fLayout.AddChidren(text1Btn);
            //可到分类-功能-电器操作使用
            //可到分类-功能-操作使用
            Button text2Btn = new Button
            {
                Width = Application.GetRealWidth(375 - 32),
@@ -90,13 +90,41 @@
            this.AddChidren(namePatchView.FLayoutView());
            namePatchView.btnText1.TextID = StringId.yaokongqimingcheng;
            namePatchView.btnText2.Text = control.name;
            namePatchView.btnClick.MouseUpEventHandler += (sender,e) => {
            //所属区域
            View.PatchView quyuPatchView = new View.PatchView();
            quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom;
            this.AddChidren(quyuPatchView.FLayoutView());
            quyuPatchView.btnText1.TextID = StringId.suoshuquyu;
            quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function);
            //继续添加
            Button addBtn = new Button
            {
                Y = quyuPatchView.frameLayout.Bottom + Application.GetRealHeight(125),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(375 - 32),
                Height = Application.GetRealHeight(20),
                TextID = StringId.jixutianjia,
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textConfirmColor,
                TextAlignment = TextAlignment.Center,
            };
            this.AddChidren(addBtn);
            //完成
            View.SaveView saveView = new View.SaveView();
            this.AddChidren(saveView.FLayoutView());
            saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            #endregion
            #region  界面点击事件
            //遥控器名称点击事件
            namePatchView.btnClick.MouseUpEventHandler += (sender, e) => {
                List<string> list = new List<string>();
                for (int i = 0; i < Pir.currPir.FunctioList.Count; i++)
                for (int i = 0; i < PirDevice.Pir.currPir.FunctioList.Count; i++)
                {
                    list.Add(Pir.currPir.FunctioList[i].name);
                    list.Add(PirDevice.Pir.currPir.FunctioList[i].name);
                }
                Method method = new Method();
                method.EditControlName(StringId.editName, list, control.name, (name, view) =>
@@ -127,7 +155,7 @@
                                else
                                {
                                    Method methodError = new Method();
                                    methodError.ErrorShow(responsePackNew,"");
                                    methodError.ErrorShow(responsePackNew, "");
                                }
                            });
@@ -139,12 +167,7 @@
                }, () => { });
            };
            //所属区域
            View.PatchView quyuPatchView = new View.PatchView();
            quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom;
            this.AddChidren(quyuPatchView.FLayoutView());
            quyuPatchView.btnText1.TextID = StringId.suoshuquyu;
            quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function);
            //所属区域点击事件
            quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
                Method method = new Method();
@@ -154,31 +177,6 @@
                    quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function);
                });
            };
            //继续添加
            Button addBtn = new Button
            {
                Y = quyuPatchView.frameLayout.Bottom + Application.GetRealHeight(125),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(375 - 32),
                Height = Application.GetRealHeight(20),
                TextID = StringId.jixutianjia,
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textConfirmColor,
                TextAlignment = TextAlignment.Center,
            };
            this.AddChidren(addBtn);
            //完成
            View.SaveView saveView = new View.SaveView();
            this.AddChidren(saveView.FLayoutView());
            saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            #endregion
            #region  界面点击事件
            //遥控器名称点击事件
            namePatchView.btnClick.MouseUpEventHandler += (sender, e) => { };
            //所属区域点击事件
            quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => { };
            //继续添加点击事件
            addBtn.MouseUpEventHandler += (sender, e) =>
            {
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -177,9 +177,9 @@
                if (StringId.xiugaimingzi == intValue)
                {
                    List<string> list = new List<string>();
                    for (int b = 0; b < Pir.pirDeviceList.Count; b++)
                    for (int b = 0; b < PirDevice.Pir.pirDeviceList.Count; b++)
                    {
                        list.Add(Pir.pirDeviceList[b].name);
                        list.Add(PirDevice.Pir.pirDeviceList[b].name);
                    }
                    Method methodView = new Method();
                    methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) =>
@@ -202,12 +202,16 @@
                    TipPopView tipPopView = new TipPopView();
                    tipPopView.TipBox(StringId.tip, text, (dialog) =>
                    {
                        Thread(dialog, (responsePackNew) =>
                        {
                            dialog.Close();
                            UIView(vv);
                        }, "删除", pirclick.deviceId, "");
                                {
                                    var pir = Pir.pirDeviceList.Find((c) => c.deviceId == pirclick.deviceId);
                                    if (pir != null)
                                    {
                                        Pir.pirDeviceList.Remove(pirclick);
                                    }
                                    dialog.Close();
                                    UIView(vv);
                                }, "删除", pirclick.deviceId, "");
                    }, () =>
                    {
                        NewSwitchView(pirclick, vv);
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -181,10 +181,24 @@
                                var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Pir>(str);
                                if (pirJosn != null)
                                {
                                    if (null == Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
/* 项目“HDL-ON_iOS”的未合并的更改
在此之前:
                                    if (null == Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
在此之后:
                                    if (null == list.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
*/
                                    if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
                                    {
                                        Pir.pirDeviceList.Add(pirJosn);
/* 项目“HDL-ON_iOS”的未合并的更改
在此之前:
                                        Pir.pirDeviceList.Add(pirJosn);
在此之后:
                                        list.pirDeviceList.Add(pirJosn);
*/
                                        PirDevice.Pir.pirDeviceList.Add(pirJosn);
                                    }
                                }
@@ -320,6 +334,7 @@
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 发送命令线程
        /// </summary>
@@ -327,15 +342,113 @@
        /// <param name="action">回调函数</param>
        /// <param name="str">判断字符</param>
        /// <param name="frame">log父控件</param>
        /// <param name="dialog">log父控件</param>
        public void ThreadSend(Control control, Action<HDL_ON.DAL.Server.ResponsePackNew> action, string str, FrameLayout frame, Dialog dialog)
        public void ThreadSend(Control control, Action<ResponsePackNew> action, string str, FrameLayout frame)
        {
            //加载log
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            ResponsePackNew responsePackNew = null;
            new System.Threading.Thread(() =>
            {
                try
                {
                    if (str == "删除")
                    {
                        responsePackNew = PirSend.DeleteDevice(control.deviceId);
                    }
                    else if (str == "修改名称")
                    {
                        responsePackNew = PirSend.DeviceRename(control.deviceId, control.name);
                    }
                    else if (str == "删除按键") {
                       // responsePackNew = PirSend.CodeRemove(control.deviceId, control.name);
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                            action(responsePackNew);
                        }
                        else
                        {
                            Method method = new Method();
                            method.ErrorShow(responsePackNew, "");
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 发送命令线程
        /// </summary>
        /// <param name="control">发送数据对象</param>
        /// <param name="action">回调函数</param>
        /// <param name="str">判断字符</param>
        /// <param name="dialog">log父控件</param>
        public void ThreadSend(Control control, Action<ResponsePackNew> action, string str,Dialog dialog)
        {
            //加载log
            Loading loading = new Loading();
            dialog.AddChidren(loading);
            ResponsePackNew responsePackNew = null;
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    if (str == "删除")
                    {
                        responsePackNew = PirSend.DeleteDevice(control.deviceId);
                    }
                    else if (str == "修改名称")
                    {
                        responsePackNew = PirSend.DeviceRename(control.deviceId, control.name);
                    }
                    else if (str == "删除按键")
                    {
                       // responsePackNew = PirSend.CodeRemove(control.deviceId, control.name);
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                            action(responsePackNew);
                        }
                        else
                        {
                            Method method = new Method();
                            method.ErrorShow(responsePackNew, "");
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// MQTT主题推送下来的遥控器数据
        /// </summary>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs
@@ -5,7 +5,7 @@
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
{
    [System.Serializable]
    public class Pir : Entity.Function
    public class Pir : Entity.Function
    {
        /// <summary>
        /// 红外宝列表
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -10,7 +10,6 @@
        public PirMain()
        {
            Tag = "PirMain";
        }
        /// <summary>
        /// 临时储存设备类型列表
@@ -28,117 +27,10 @@
            middFLayout.Y = Application.GetRealHeight(64);
            middFLayout.Height = Application.GetRealHeight(667 - 64);
            this.AddChidren(middFLayout);
            FrameLayout pirDeviceFLayout = new FrameLayout();
            pirDeviceFLayout.Y = Application.GetRealHeight(12);
            pirDeviceFLayout.X = Application.GetRealWidth(16);
            pirDeviceFLayout.Width = Application.GetRealWidth(343);
            pirDeviceFLayout.Height = Application.GetRealHeight(187);
            pirDeviceFLayout.BackgroundColor = CSS.CSS_Color.view;
            pirDeviceFLayout.Radius = (uint)Application.GetRealHeight(12);
            middFLayout.AddChidren(pirDeviceFLayout);
            //设备管理
            Button text1Btn = new Button
            {
                Y = Application.GetRealHeight(11),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(120),
                Height = Application.GetRealHeight(20),
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textConfirmColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextID = StringId.shebeigaunli,
                IsBold = true,
            };
            pirDeviceFLayout.AddChidren(text1Btn);
            Button pirIcon = new Button
            {
                Y = Application.GetRealHeight(47),
                X = Application.GetRealWidth(28),
                Width = Application.GetRealWidth(66),
                Height = Application.GetRealWidth(66),
                UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
            };
            pirDeviceFLayout.AddChidren(pirIcon);
            //mini智能遥控器
            Button text2Btn = new Button
            {
                Y = Application.GetRealHeight(70),
                X = Application.GetRealWidth(112),
                Width = Application.GetRealWidth(120),
                Height = Application.GetRealHeight(20),
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textTipColor,
                TextAlignment = TextAlignment.CenterLeft,
                Text = "mini智能遥控器",
            };
            pirDeviceFLayout.AddChidren(text2Btn);
            //红外宝数量
            Button numberDeviceBtn = new Button
            {
                Y = Application.GetRealHeight(137),
                X = Application.GetRealWidth(32),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealHeight(20),
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textColor,
                TextAlignment = TextAlignment.CenterLeft,
                Text = "1" + Language.StringByID(StringId.ge),
                IsBold = true,
            };
            pirDeviceFLayout.AddChidren(numberDeviceBtn);
            //当前红外遥控设备
            Button numberDeviceTextBtn = new Button
            {
                Y = numberDeviceBtn.Bottom + Application.GetRealHeight(4),
                X = Application.GetRealWidth(32),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealHeight(14),
                TextSize = TextSize.text10,
                TextColor = CSS.CSS_Color.textCancelColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextID = StringId.dangqianhongwaishebei,
            };
            pirDeviceFLayout.AddChidren(numberDeviceTextBtn);
            //所有红外宝的遥控器数量
            Button currDeviceNumberControlBtn = new Button
            {
                Y = Application.GetRealHeight(137),
                X = Application.GetRealWidth(198),
                Width = Application.GetRealWidth(80),
                Height = Application.GetRealHeight(20),
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textColor,
                TextAlignment = TextAlignment.CenterLeft,
                Text = "1" + Language.StringByID(StringId.ge),
                IsBold = true,
            };
            pirDeviceFLayout.AddChidren(currDeviceNumberControlBtn);
            //已添加遥控器
            Button currDeviceNumberControlTextBtn = new Button
            {
                Y = currDeviceNumberControlBtn.Bottom + Application.GetRealHeight(4),
                X = Application.GetRealWidth(198),
                Width = Application.GetRealWidth(80),
                Height = Application.GetRealHeight(14),
                TextSize = TextSize.text10,
                TextColor = CSS.CSS_Color.textCancelColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextID = StringId.yitianjiayaokongqi,
            };
            pirDeviceFLayout.AddChidren(currDeviceNumberControlTextBtn);
            ///红外宝点击事件
            FrameLayout clickFLayout = new FrameLayout();
            pirDeviceFLayout.AddChidren(clickFLayout);
            View.MainView mainView = new View.MainView();
            mainView.Show(middFLayout);
            FrameLayout deviceListFLayout = new FrameLayout();
            deviceListFLayout.Y = pirDeviceFLayout.Bottom + Application.GetRealHeight(12);
            deviceListFLayout.Y = mainView.pirDeviceFLayout.Bottom + Application.GetRealHeight(12);
            deviceListFLayout.X = Application.GetRealWidth(16);
            deviceListFLayout.Width = Application.GetRealWidth(343);
            deviceListFLayout.Height = Application.GetRealHeight(328);
@@ -172,18 +64,6 @@
                Text = "mini智能遥控器",
            };
            deviceListFLayout.AddChidren(deviceNameBtn);
            if (Pir.pirDeviceList.Count != 0)
            {
                Pir.currPir = Pir.pirDeviceList[0];
                int sum = 0;
                for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                {
                    sum += Pir.pirDeviceList[i].FunctioList.Count;
                }
                deviceNameBtn.Text = Pir.pirDeviceList[0].name;
                numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge);
                currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge);
            }
            //下拉图标
            var dropdownIconBtn = new Button
@@ -195,94 +75,24 @@
                UnSelectedImagePath = "PirIcon/dropdown.png",
            };
            deviceListFLayout.AddChidren(dropdownIconBtn);
            #endregion
            deviceNameBtn.MouseUpEventHandler += (sender, e) =>
            if (Pir.pirDeviceList.Count != 0)
            {
                #region 区域弹框界面
                FrameLayout fLayout = new FrameLayout
                {
                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
                };
                this.AddChidren(fLayout);
                fLayout.MouseUpEventHandler += (sender1, e1) =>
                {
                    fLayout.RemoveFromParent();
                };
                FrameLayout iconFLyout = new FrameLayout
                {
                    X = Application.GetRealWidth(205),
                    Y = Application.GetRealHeight(314),
                    Width = Application.GetRealWidth(160),
                    Height = Application.GetRealHeight(21 + 44),
                    //BackgroundImagePath = "LogicIcon/bjicon.png",
                };
                fLayout.AddChidren(iconFLyout);
                FrameLayout textFLyout = new FrameLayout
                {
                    X = Application.GetRealWidth(8),
                    Y = Application.GetRealHeight(14),
                    Width = Application.GetRealWidth(144),
                    Height = Application.GetRealHeight(44),
                };
                VerticalScrolViewLayout vv = new VerticalScrolViewLayout
                {
                    X = Application.GetRealWidth(8),
                    Y = Application.GetRealHeight(14),
                    Width = Application.GetRealWidth(144),
                    Height = Application.GetRealHeight(44 * 4),
                };
                if (Pir.pirDeviceList.Count > 4)
                {
                    iconFLyout.Height = Application.GetRealHeight(21 + 44 * 4);
                    iconFLyout.AddChidren(vv);
                    iconFLyout.BackgroundImagePath = "PirIcon/4.png";
                }
                else
                {
                    iconFLyout.AddChidren(textFLyout);
                    iconFLyout.Height = Application.GetRealHeight(21 + 44 * Pir.pirDeviceList.Count);
                    textFLyout.Height = Application.GetRealHeight(44 * Pir.pirDeviceList.Count);
                    iconFLyout.BackgroundImagePath = $"PirIcon/{Pir.pirDeviceList.Count}.png";
                }
                #endregion
                //默认第一个红外宝
                Pir.currPir = Pir.pirDeviceList[0];
                int sum = 0;
                for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                {
                    var pirJson = Pir.pirDeviceList[i];
                    View.PirNameView pirNameView = new View.PirNameView();
                    if (Pir.pirDeviceList.Count > 4)
                    {
                        vv.AddChidren(pirNameView.FLayoutView());
                    }
                    else
                    {
                        pirNameView.frameLayout.Y = Application.GetRealHeight(i * 44);
                        textFLyout.AddChidren(pirNameView.FLayoutView());
                    }
                    pirNameView.btnName.Text = pirJson.name;
                    pirNameView.btnClick.Tag = pirJson;
                    pirNameView.btnClick.MouseUpEventHandler += (sender2, e2) =>
                    {
                        fLayout.RemoveFromParent();
                        deviceNameBtn.Text = pirJson.name;
                        Pir.currPir = pirJson;
                    };
                    if (Pir.pirDeviceList.Count - 1 == i)
                    {
                        ///改变最后那条一个线的颜色,界面显示效果作用;
                        pirNameView.btnLine.BackgroundColor = CSS.CSS_Color.view;
                    }
                    //查找
                    sum += Pir.pirDeviceList[i].FunctioList.Count;
                }
            };
            ///
            clickFLayout.MouseUpEventHandler += (sender, e) =>
                deviceNameBtn.Text = Pir.pirDeviceList[0].name;
                mainView.numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge);
                mainView.currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge);
            }
            ///设备管理的点击事件
            mainView.clickBtn.MouseUpEventHandler += (sender, e) =>
            {
                DeviceSet deviceSet = new DeviceSet();
@@ -292,21 +102,30 @@
                    if (Pir.currPir != null)
                    {
                        deviceNameBtn.Text = Pir.currPir.name;
                        deviceNameBtn.Text = Pir.pirDeviceList[0].name;
                        numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge);
                        mainView.numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge);
                    }
                    int sum = 0;
                    for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                    {
                        sum += Pir.pirDeviceList[i].FunctioList.Count;
                    }
                    currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge);
                    mainView.currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge);
                });
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            #endregion
            ///红外名称的点击事件
            deviceNameBtn.MouseUpEventHandler += (sender, e) =>
            {
                View.HeigthChangeView heigthChangeView = new View.HeigthChangeView();
                heigthChangeView.Show(this, Pir.pirDeviceList, (pirJson) =>
                {
                    deviceNameBtn.Text = pirJson.name;
                    Pir.currPir = pirJson;
                });
            };
            int line = 0;
            for (int i = 1, j = 0; i <= 7; i++, j++)
            {
@@ -367,11 +186,11 @@
                    {
                        if (DeviceTypeList.Count == 0)
                        {
                            GetDeviceTypeList(true,() =>
                            {
                                DeviceTypeViewClick(if_value);
                            GetDeviceTypeList(true, () =>
                             {
                                 DeviceTypeViewClick(if_value);
                            });
                             });
                        }
                        else
                        {
@@ -380,14 +199,13 @@
                    }
                };
            }
            GetDeviceTypeList(false,() => { });
        }
        /// <summary>
        /// 设备进入下一级方法
        /// </summary>
        /// <param name="if_value"></param>
        void DeviceTypeViewClick(int if_value) {
        private void DeviceTypeViewClick(int if_value)
        {
            var strings = GetTypeString(if_value).Split('-');
            var jobDeviceType = DeviceTypeList.Find((c) => c.deviceType == strings[0]);
            if (jobDeviceType == null)
@@ -587,7 +405,7 @@
        /// </summary>
        /// <param name="tag">标识要不要提示(true=提示)</param>
        /// <param name="action">回调函数</param>
        private void GetDeviceTypeList(bool tag,Action action)
        public  void GetDeviceTypeList(bool tag, Action action)
        {
            PirSend.GetDeviceTypesList(this, (responsePackNew) =>
            {
@@ -614,9 +432,10 @@
                }
                else
                {
                    if (tag) {
                    if (tag)
                    {
                        Method method = new Method();
                        method.ErrorShow(responsePackNew,"");
                        method.ErrorShow(responsePackNew, "");
                    }
                }
            }, "", "设备类型列表");
@@ -624,7 +443,7 @@
        /// <summary>
        /// 读取红外设备类型的品牌列表
        /// </summary>
        private void GetBrandList(string id, Action<List<Brand>> actionBrand)
        public  void GetBrandList(string id, Action<List<Brand>> actionBrand)
        {
            List<Brand> brandList = new List<Brand>();
            PirSend.GetDeviceTypesList(this, (responsePackNew) =>
@@ -653,7 +472,7 @@
                else
                {
                    Method method = new Method();
                    method.ErrorShow(responsePackNew,"");
                    method.ErrorShow(responsePackNew, "");
                }
            }, id, "品牌列表");
        }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs
New file
@@ -0,0 +1,113 @@
using System;
using Shared;
using System.Collections.Generic;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View
{
    public class HeigthChangeView
    {
        /// <summary>
        /// 背景
        /// </summary>
        FrameLayout fLayout = new FrameLayout
        {
            BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
        };
        /// <summary>
        ///
        /// </summary>
        FrameLayout iconFLyout = new FrameLayout
        {
            X = Application.GetRealWidth(205),
            Y = Application.GetRealHeight(314),
            Width = Application.GetRealWidth(160),
            Height = Application.GetRealHeight(21 + 44),
            //BackgroundImagePath = "LogicIcon/bjicon.png",
        };
        /// <summary>
        ///
        /// </summary>
        FrameLayout textFLyout = new FrameLayout
        {
            X = Application.GetRealWidth(8),
            Y = Application.GetRealHeight(14),
            Width = Application.GetRealWidth(144),
            Height = Application.GetRealHeight(44),
        };
        /// <summary>
        ///
        /// </summary>
        VerticalScrolViewLayout vv = new VerticalScrolViewLayout
        {
            X = Application.GetRealWidth(8),
            Y = Application.GetRealHeight(14),
            Width = Application.GetRealWidth(144),
            Height = Application.GetRealHeight(44 * 4),
        };
        /// <summary>
        /// View方法
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="list"></param>
        /// <param name="action"></param>
        public void Show(FrameLayout frame, List<Pir> list, Action<Pir> action)
        {
            frame.AddChidren(fLayout);
            fLayout.AddChidren(iconFLyout);
            fLayout.MouseUpEventHandler += (sender1, e1) =>
            {
                fLayout.RemoveFromParent();
            };
            if (list.Count > 4)
            {
                iconFLyout.Height = Application.GetRealHeight(21 + 44 * 4);
                iconFLyout.AddChidren(vv);
                iconFLyout.BackgroundImagePath = "PirIcon/4.png";
            }
            else
            {
                iconFLyout.AddChidren(textFLyout);
                iconFLyout.Height = Application.GetRealHeight(21 + 44 * list.Count);
                textFLyout.Height = Application.GetRealHeight(44 * list.Count);
                iconFLyout.BackgroundImagePath = $"PirIcon/{list.Count}.png";
            }
            for (int i = 0; i < list.Count; i++)
            {
                var pirJson = list[i];
                View.PirNameView pirNameView = new View.PirNameView();
                if (list.Count > 4)
                {
                    vv.AddChidren(pirNameView.FLayoutView());
                }
                else
                {
                    pirNameView.frameLayout.Y = Application.GetRealHeight(i * 44);
                    textFLyout.AddChidren(pirNameView.FLayoutView());
                }
                pirNameView.btnName.Text = pirJson.name;
                pirNameView.btnClick.Tag = pirJson;
                pirNameView.btnClick.MouseUpEventHandler += (sender2, e2) =>
                {
                    var pir = pirNameView.btnClick.Tag as Pir;
                    action(pir);
                    fLayout.RemoveFromParent();
                    //deviceNameBtn.Text = pirJson.name;
                    //Pir.currPir = pirJson;
                };
                if (list.Count - 1 == i)
                {
                    ///改变最后那条一个线的颜色,界面显示效果作用;
                    pirNameView.btnLine.BackgroundColor = CSS.CSS_Color.view;
                }
            }
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/MainView.cs
New file
@@ -0,0 +1,143 @@
using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View
{
    public class MainView
    {
        /// <summary>
        /// 主空间
        /// </summary>
        public FrameLayout pirDeviceFLayout = new FrameLayout
        {
            Y = Application.GetRealHeight(12),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(343),
            Height = Application.GetRealHeight(187),
            BackgroundColor = CSS.CSS_Color.view,
            Radius = (uint)Application.GetRealHeight(12),
        };
        /// <summary>
        /// 设备管理
        /// </summary>
        public Button text1Btn = new Button
        {
            Y = Application.GetRealHeight(11),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(120),
            Height = Application.GetRealHeight(20),
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textConfirmColor,
            TextAlignment = TextAlignment.CenterLeft,
            TextID = StringId.shebeigaunli,
            IsBold = true,
        };
        /// <summary>
        /// 图标
        /// </summary>
        public Button pirIcon = new Button
        {
            Y = Application.GetRealHeight(47),
            X = Application.GetRealWidth(28),
            Width = Application.GetRealWidth(66),
            Height = Application.GetRealWidth(66),
            UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
        };
        /// <summary>
        /// mini智能遥控器
        /// </summary>
        public Button text2Btn = new Button
        {
            Y = Application.GetRealHeight(70),
            X = Application.GetRealWidth(112),
            Width = Application.GetRealWidth(120),
            Height = Application.GetRealHeight(20),
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textTipColor,
            TextAlignment = TextAlignment.CenterLeft,
            Text = "mini智能遥控器",
        };
        /// <summary>
        /// 红外宝数量
        /// </summary>
        public Button numberDeviceBtn = new Button
        {
            Y = Application.GetRealHeight(137),
            X = Application.GetRealWidth(32),
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealHeight(20),
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textColor,
            TextAlignment = TextAlignment.CenterLeft,
            Text = "1" + Language.StringByID(StringId.ge),
            IsBold = true,
        };
        /// <summary>
        /// 当前红外遥控设备
        /// </summary>
        public Button numberDeviceTextBtn = new Button
        {
            Y = Application.GetRealHeight(137 + 20) + Application.GetRealHeight(4),
            X = Application.GetRealWidth(32),
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealHeight(14),
            TextSize = TextSize.text10,
            TextColor = CSS.CSS_Color.textCancelColor,
            TextAlignment = TextAlignment.CenterLeft,
            TextID = StringId.dangqianhongwaishebei,
        };
        /// <summary>
        /// 所有红外宝的遥控器数量
        /// </summary>
        public Button currDeviceNumberControlBtn = new Button
        {
            Y = Application.GetRealHeight(137),
            X = Application.GetRealWidth(198),
            Width = Application.GetRealWidth(80),
            Height = Application.GetRealHeight(20),
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textColor,
            TextAlignment = TextAlignment.CenterLeft,
            Text = "1" + Language.StringByID(StringId.ge),
            IsBold = true,
        };
        /// <summary>
        /// 已添加遥控器
        /// </summary>
        public Button currDeviceNumberControlTextBtn = new Button
        {
            Y = Application.GetRealHeight(137 + 20) + Application.GetRealHeight(4),
            X = Application.GetRealWidth(198),
            Width = Application.GetRealWidth(80),
            Height = Application.GetRealHeight(14),
            TextSize = TextSize.text10,
            TextColor = CSS.CSS_Color.textCancelColor,
            TextAlignment = TextAlignment.CenterLeft,
            TextID = StringId.yitianjiayaokongqi,
        };
        ///红外宝点击事件
        public Button clickBtn = new Button();
        public void Show(FrameLayout middFLayout)
        {
            middFLayout.AddChidren(pirDeviceFLayout);
            pirDeviceFLayout.AddChidren(text1Btn);
            pirDeviceFLayout.AddChidren(pirIcon);
            pirDeviceFLayout.AddChidren(text2Btn);
            pirDeviceFLayout.AddChidren(numberDeviceBtn);
            pirDeviceFLayout.AddChidren(numberDeviceTextBtn);
            pirDeviceFLayout.AddChidren(currDeviceNumberControlBtn);
            pirDeviceFLayout.AddChidren(currDeviceNumberControlTextBtn);
            pirDeviceFLayout.AddChidren(clickBtn);
        }
    }
}