xm
2021-11-24 a448538f9279d76158bd010e696e7012c0696439
2021-11-24-02

合并上传
4个文件已修改
967 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs 778 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,25 +1,15 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.SiriIntentUI>
    <MonoDevelop.MacDev.AppleDevelopmentTeam />
  </MonoDevelop.Ide.ItemProperties.SiriIntentUI>
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Server/HttpUtil.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs" Line="203" Column="17" IsPinned="True" />
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="21" Column="79" />
    </Files>
  <MonoDevelop.Ide.Workbench>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL-ON_iOS" expanded="True" selected="True" />
            <Node name="HDL-ON_Android" selected="True" />
          </Node>
        </State>
      </Pad>
      <Pad Id="MonoDevelop.Debugger.WatchPad">
        <State>
          <Value>tempFunction.deviceId</Value>
          <Value>updata2.ToString()</Value>
        </State>
      </Pad>
    </Pads>
@@ -32,14 +22,14 @@
    <String>SiriIntent/SiriIntent.csproj</String>
    <String>SceneKit/SceneKit.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.2ffc9a07" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="28" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL-ON_iOS/Other/SkipControl.cs" relfile="HDL-ON_iOS/Other/SkipControl.cs" line="25" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="14" column="1" />
      <Breakpoint file="/Users/hdl/Desktop/git/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="28" column="1" />
      <Breakpoint file="/Users/hdl/Desktop/git/HDL_APP_Project/HDL-ON_iOS/Other/SkipControl.cs" relfile="HDL-ON_iOS/Other/SkipControl.cs" line="25" column="1" />
      <Breakpoint file="/Users/hdl/Desktop/git/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="14" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
</Properties>
</Properties>
HDL-ON_Android/HDL-ON_Android.csproj
@@ -33,7 +33,6 @@
    <DefineConstants>DEBUG;TRACE;__Android__</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
    <MandroidI18n>cjk</MandroidI18n>
    <AndroidDexTool>d8</AndroidDexTool>
    <AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent>
@@ -62,7 +61,7 @@
    <AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent>
    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
    <AndroidKeyStore>True</AndroidKeyStore>
    <AndroidSigningKeyStore>/Users/kaede/Desktop/HDL_APP_Project/on_plus.keystore</AndroidSigningKeyStore>
    <AndroidSigningKeyStore>/Users/hdl/Desktop/on_plus/on_plus.keystore</AndroidSigningKeyStore>
    <AndroidSigningStorePass>85521566</AndroidSigningStorePass>
    <AndroidSigningKeyPass>85521566</AndroidSigningKeyPass>
    <AndroidSigningKeyAlias>on_plus</AndroidSigningKeyAlias>
HDL_ON/UI/MainPage.cs
@@ -26,14 +26,14 @@
    /// <summary>
    /// 版本号
    /// </summary>
    public static string VersionString = "1.3.1103";
    public static string VersionString = "1.3.1123";
    ///// <summary>
    ///// 客户端类型
    ///// </summary>
    //public static string ClientType = APIClientType.HDL_ON_PRO.ToString();
    /// <summary>
    ///
    ///
    /// </summary>
    public static Entity.CityInfo cityInfo = new Entity.CityInfo();
    /// <summary>
@@ -86,84 +86,8 @@
    /// </summary>
    public static bool Increase
    {
        /// <summary>
        /// BaseView
        /// </summary>
        public static FrameLayout BaseView { get; internal set; }
        /// <summary>
        /// BasePageView
        /// </summary>
        public static PageLayout BasePageView { get; set; }
        /// <summary>
        /// 用户控制父容器
        /// </summary>
        public static UserPage UserBasePage;
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.3.1123";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
        //public static string ClientType = APIClientType.HDL_ON_PRO.ToString();
        /// <summary>
        ///
        /// </summary>
        public static Entity.CityInfo cityInfo = new Entity.CityInfo();
        /// <summary>
        /// 天气刷新action
        /// </summary>
        public static Action RefreshAir;
        /// <summary>
        /// 回退页面action 没有需要可以不用
        /// </summary>
        public static Action ReturnRefreshAction;
        /// <summary>
        /// 无登录模式
        /// </summary>
        public static bool NoLoginMode = false;
        /// <summary>
        /// 网络连接状态
        /// 0:无网络
        /// </summary>
        public static int InternetStatus = 2;
        /// <summary>
        /// 是否进入后台
        /// </summary>
        public static bool IsEnterBackground = false;
        /// <summary>
        /// 当前分页索引
        /// 0:收藏
        /// 1:分类
        /// 2:智能
        /// 3:个人
        /// </summary>
        public static int CurPageIndex = 9999;
        ///// <summary>
        ///// 公司代码
        ///// 预留第三方定制标记
        ///// 0:HDL
        ///// </summary>
        //public static int Company = 0;
        /// <summary>
        /// 右滑后退提示按钮
        /// </summary>
        public static Button BtnBackIcon;
        /// <summary>
        /// 后退右滑了多少距离,超过一定距离才触发后退事件
        /// </summary>
        public static int StartX = 0;
        /// <summary>
        /// 是否全面屏手机
        /// </summary>
        public static bool Increase
        {
            get
            {
      get
      {
#if __IOS__
                if (Application.PhoneType>10)
                {
@@ -222,8 +146,6 @@
        BaseView = Application.MainPage;
        Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor;
        //#region 测试
        //var ddd = new UI.test.TestDialog();
        //ddd.InitView();
@@ -420,30 +342,30 @@
        {
          Entity.FunctionList.List.Clear();
          Entity.SpatialInfo.CurrentSpatial.Clear();
                ///等待获取住宅信息
                Application.RunOnMainThread(() =>
               {
                if (waitPage != null)
                {
                  waitPage.RemoveFromParent();
                  waitPage = null;
                }
          ///等待获取住宅信息
          Application.RunOnMainThread(() =>
          {
            if (waitPage != null)
            {
              waitPage.RemoveFromParent();
              waitPage = null;
            }
                      //跳转页面----
                      UserBasePage = new UserPage();
                BasePageView.AddChidren(UserBasePage);
                UserBasePage.LoadPage();
                BasePageView.PageIndex = 0;
            //跳转页面----
            UserBasePage = new UserPage();
            BasePageView.AddChidren(UserBasePage);
            UserBasePage.LoadPage();
            BasePageView.PageIndex = 0;
                if (isFirstOpen)
                {
                        //启动密码验证
                        new AppUnlockPage().LoadPage(isFirstOpen);
                }
                      //主页加载完成,回调事件
                      pageShowEvent?.Invoke();
                pageShowEvent = null;
              });
            if (isFirstOpen)
            {
              //启动密码验证
              new AppUnlockPage().LoadPage(isFirstOpen);
            }
            //主页加载完成,回调事件
            pageShowEvent?.Invoke();
            pageShowEvent = null;
          });
        }
        catch (Exception ex)
        {
@@ -452,14 +374,14 @@
        finally
        {
          Application.RunOnMainThread(() =>
                {
                if (downloadData)
                {
                  DB_ResidenceData.Instance.EixtAccount();
                        ///初始化app数据
                        Common.ApiUtlis.Ins.DownloadData();
                };
              });
          {
            if (downloadData)
            {
              DB_ResidenceData.Instance.EixtAccount();
              ///初始化app数据
              Common.ApiUtlis.Ins.DownloadData();
            };
          });
        }
      }).Start();
@@ -479,7 +401,7 @@
        if (BasePageView == null || BasePageView.ChildrenCount <= 1)
        {
          result = 2;//无法再后退,可以执行退到桌面
              }
        }
        if (BasePageView.ChildrenCount > 1)
        {
          int index = BasePageView.ChildrenCount - 1;
@@ -488,14 +410,14 @@
          {
            var loading = view as Loading;
            if (loading.CurStatus == false)//有一些等待界面隐藏了,但是没有移除到,需要先移除
                  {
            {
              loading.RemoveFromParent();
              result = LoadEvent_BackAction();
            }
            else
            {
              result = 1;//正在等待某些操作
                  }
            }
          }
          else
          {
@@ -522,7 +444,7 @@
        else
        {
          result = 2;//无法再后退,可以执行退到桌面
              }
        }
      });
      return result;
    }
@@ -534,11 +456,11 @@
    public static void Log(string msg)
    {
#if DEBUG
      Console.WriteLine(msg);
            Console.WriteLine(msg);
#endif
    }
  }
}
}
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
@@ -7,361 +7,363 @@
namespace HDL_ON.UI
{
    public class AddOutputPage : FrameLayout
  public class AddOutputPage : FrameLayout
  {
    FrameLayout bodyView;
    FrameLayout showdFunctionTypeRow;
    /// <summary>
    /// 楼层选择下拉图标
    /// </summary>
    Button btnFloorDownIcon;
    /// <summary>
    /// 楼层显示
    /// </summary>
    Button btnFloor;
    /// <summary>
    /// 筛选文本显示
    /// </summary>
    Button btnScreenText;
    VerticalScrolViewLayout functionListView;
    SecurityAlarm securityAlarm;
    Action<SecurityAlarm> refreshAction;
    List<SecurityOutput> outputList = new List<SecurityOutput>();
    List<Function> allocatedList = new List<Function>();
    public AddOutputPage(SecurityAlarm function, Action<SecurityAlarm> action)
    {
        FrameLayout bodyView;
      bodyView = this;
      securityAlarm = function;
      refreshAction = action;
    }
        FrameLayout showdFunctionTypeRow;
        /// <summary>
        /// 楼层选择下拉图标
        /// </summary>
        Button btnFloorDownIcon;
        /// <summary>
        /// 楼层显示
        /// </summary>
        Button btnFloor;
    /// <summary>
    /// 加载界面
    /// </summary>
    public void LoadPage()
    {
      bodyView.BackgroundColor = CSS_Color.BackgroundColor;
      new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)).LoadTopView();
        /// <summary>
        /// 筛选文本显示
        /// </summary>
        Button btnScreenText;
      #region 显示的功能类型切换区域
      showdFunctionTypeRow = new FrameLayout()
      {
        Y = Application.GetRealHeight(64),
        Height = Application.GetRealHeight(62),
        BackgroundColor = CSS_Color.MainBackgroundColor,
      };
      bodyView.AddChidren(showdFunctionTypeRow);
        VerticalScrolViewLayout functionListView;
        SecurityAlarm securityAlarm;
        Action<SecurityAlarm> refreshAction;
        List<SecurityOutput> outputList = new List<SecurityOutput>();
      btnFloorDownIcon = new Button()
      {
        Width = Application.GetMinRealAverage(16),
        Height = Application.GetMinRealAverage(16),
        X = Application.GetRealWidth(16),
        Y = Application.GetRealHeight(18),
        UnSelectedImagePath = "Public/DownIcon.png",
      };
      showdFunctionTypeRow.AddChidren(btnFloorDownIcon);
        List<Function> allocatedList = new List<Function>();
      btnFloor = new Button()
      {
        X = btnFloorDownIcon.Right,
        Y = Application.GetRealHeight(18),
        Width = Application.GetRealWidth(200),
        Height = Application.GetMinRealAverage(16),
        TextColor = CSS_Color.FirstLevelTitleColor,
        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
        TextAlignment = TextAlignment.CenterLeft,
        Text = DB_ResidenceData.Instance.CurFloor.roomName,
      };
      showdFunctionTypeRow.AddChidren(btnFloor);
        public AddOutputPage(SecurityAlarm function, Action<SecurityAlarm> action)
      #endregion
      functionListView = new VerticalScrolViewLayout()
      {
        Y = showdFunctionTypeRow.Bottom,
        Height = Application.GetRealHeight(530 - 100),
        BackgroundColor = CSS_Color.BackgroundColor,
      };
      bodyView.AddChidren(functionListView);
      foreach (var function in FunctionList.List.Functions)
      {
        if (!MainPage.SceneSupportFunctionList.Contains(function.spk))
        {
            bodyView = this;
            securityAlarm = function;
            refreshAction = action;
          continue;
        }
        if (function == null)
        {
          continue;
        }
        function.roomIds.Remove(null);
        allocatedList.Add(function);
      }
      LoadFunctionListRow(null);
      var bottomView = new FrameLayout()
      {
        Y = Application.GetRealHeight(591),
        Height = Application.GetRealHeight(100),
        BackgroundColor = CSS_Color.MainBackgroundColor,
        Radius = (uint)Application.GetRealWidth(22),
      };
      this.AddChidren(bottomView);
      var btnConfrim = new Button()
      {
        X = Application.GetRealWidth(78),
        Y = Application.GetRealHeight(12),
        Width = Application.GetRealWidth(220),
        Height = Application.GetRealWidth(44),
        Radius = (uint)Application.GetRealWidth(22),
        BackgroundColor = CSS_Color.MainColor,
        TextID = StringId.Confirm,
        TextSize = CSS_FontSize.SubheadingFontSize,
        TextColor = CSS_Color.MainBackgroundColor,
        TextAlignment = TextAlignment.Center,
      };
      bottomView.AddChidren(btnConfrim);
      btnConfrim.MouseUpEventHandler = (sender, e) =>
      {
        securityAlarm.output = new List<SecurityOutput>();
        foreach (var output in outputList)
        {
          if (output.addCondition)
          {
            securityAlarm.output.Add(output);
          }
        }
        this.RemoveFromParent();
        refreshAction?.Invoke(securityAlarm);
      };
    }
    // <summary>
    /// 显示功能Row
    /// </summary>
    void LoadFunctionListRow(List<Function> functions)
    {
      functionListView.RemoveAll();
      if (functions == null)
      {
        functions = allocatedList;
      }
      foreach (var function in functions)
      {
        var output = securityAlarm.output.Find((obj) => obj.sid == function.sid);
        if (output == null)
        {
          output = new SecurityOutput();
          output.sid = function.sid;
        }
        else
        {
          output.addCondition = true;
        }
        outputList.Add(output);
        FrameLayout functionRow = new FrameLayout()
        {
          Height = Application.GetRealHeight(65),
          BackgroundColor = CSS_Color.MainBackgroundColor,
        };
        functionListView.AddChidren(functionRow);
        var btnFunctionName = new Button()
        {
          X = Application.GetRealWidth(16),
          Width = Application.GetRealWidth(200),
          Height = Application.GetRealHeight(44),
          Text = function.name,
          TextAlignment = TextAlignment.CenterLeft,
          TextColor = CSS_Color.FirstLevelTitleColor,
          TextSize = CSS_FontSize.TextFontSize,
        };
        functionRow.AddChidren(btnFunctionName);
        var btnFunctionFloorName = new Button()
        {
          X = Application.GetRealWidth(16),
          Y = Application.GetRealHeight(24),
          Width = Application.GetRealWidth(200),
          Height = Application.GetRealHeight(41),
          Text = function.GetRoomListName(),
          TextAlignment = TextAlignment.CenterLeft,
          TextColor = CSS_Color.PromptingColor1,
          TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
        };
        functionRow.AddChidren(btnFunctionFloorName);
        Button btnState = new Button()
        {
          Width = Application.GetRealWidth(317),
          TextAlignment = TextAlignment.CenterRight,
          TextSize = CSS_FontSize.TextFontSize,
          TextColor = CSS_Color.PromptingColor1,
        };
        functionRow.AddChidren(btnState);
        Button btnChooseIcon = new Button()
        {
          X = Application.GetRealWidth(333),
          Gravity = Gravity.CenterVertical,
          Width = Application.GetMinRealAverage(32),
          Height = Application.GetMinRealAverage(32),
          UnSelectedImagePath = "Public/ChooseIcon.png",
          SelectedImagePath = "Public/ChooseOnIcon.png",
        };
        functionRow.AddChidren(btnChooseIcon);
        btnChooseIcon.MouseUpEventHandler = (sender, e) =>
        {
          btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected;
          if (btnChooseIcon.IsSelected)
          {
            output.addCondition = true;
            if (output.status.Count == 0)
            {
              ShowStateDialog(output, btnState, btnChooseIcon);
            }
          }
          else
          {
            output.addCondition = false;
          }
        };
        btnState.MouseUpEventHandler = (sender, e) =>
        {
          ShowStateDialog(output, btnState, btnChooseIcon);
        };
        if (output.addCondition)
        {
          btnChooseIcon.IsSelected = true;
          btnState.Text = output.StateText();
        }
        /// <summary>
        /// 加载界面
        /// </summary>
        public void LoadPage()
        functionListView.AddChidren(new Button()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)).LoadTopView();
            #region 显示的功能类型切换区域
            showdFunctionTypeRow = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(62),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(showdFunctionTypeRow);
          Gravity = Gravity.CenterHorizontal,
          Width = Application.GetRealWidth(343),
          Height = Application.GetRealWidth(1),
          BackgroundColor = CSS_Color.DividingLineColor,
        });
            btnFloorDownIcon = new Button()
            {
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(18),
                UnSelectedImagePath = "Public/DownIcon.png",
            };
            showdFunctionTypeRow.AddChidren(btnFloorDownIcon);
            btnFloor = new Button()
            {
                X = btnFloorDownIcon.Right,
                Y = Application.GetRealHeight(18),
                Width = Application.GetRealWidth(200),
                Height = Application.GetMinRealAverage(16),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.CenterLeft,
                Text = DB_ResidenceData.Instance.CurFloor.roomName,
            };
            showdFunctionTypeRow.AddChidren(btnFloor);
            #endregion
            functionListView = new VerticalScrolViewLayout()
            {
                Y = showdFunctionTypeRow.Bottom,
                Height = Application.GetRealHeight(530 -100),
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            bodyView.AddChidren(functionListView);
      }
    }
    private void ShowStateDialog(SecurityOutput output, Button btnState, Button btnChoose = null)
    {
      Dialog dialog = new Dialog();
            foreach (var function in FunctionList.List.Functions)
            {
                if (!MainPage.SceneSupportFunctionList.Contains(function.spk))
                {
                    continue;
                }
                if (function == null)
                {
                    continue;
                }
                function.roomIds.Remove(null);
                    allocatedList.Add(function);
            }
            LoadFunctionListRow(null);
            var bottomView = new FrameLayout()
            {
                Y = Application.GetRealHeight(591),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(22),
            };
            this.AddChidren(bottomView);
            var btnConfrim = new Button()
            {
                X = Application.GetRealWidth(78),
                Y = Application.GetRealHeight(12),
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealWidth(44),
                Radius = (uint)Application.GetRealWidth(22),
                BackgroundColor = CSS_Color.MainColor,
                TextID = StringId.Confirm,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainBackgroundColor,
                TextAlignment = TextAlignment.Center,
            };
            bottomView.AddChidren(btnConfrim);
            btnConfrim.MouseUpEventHandler = (sender, e) =>
            {
                securityAlarm.output = new List<SecurityOutput>();
                foreach (var output in outputList)
                {
                    if (output.addCondition)
                    {
                        securityAlarm.output.Add(output);
                    }
                }
                this.RemoveFromParent();
                refreshAction?.Invoke(securityAlarm);
            };
      FrameLayout contentView = new FrameLayout();
      dialog.AddChidren(contentView);
      contentView.MouseUpEventHandler = (sender, e) =>
      {
        dialog.Close();
        if (output.status.Count == 0)
        {
          if (btnChoose != null)
          {
            btnChoose.IsSelected = false;
          }
        }
      };
      VerticalScrolViewLayout optinView = new VerticalScrolViewLayout()
      {
        Gravity = Gravity.CenterHorizontal,
        Y = Application.GetRealHeight(515),
        Width = Application.GetRealWidth(343),
        Height = Application.GetRealHeight(88),
        Radius = (uint)Application.GetRealHeight(13),
        BackgroundColor = CSS_Color.MainBackgroundColor,
      };
      contentView.AddChidren(optinView);
      Button btnOpen = new Button()
      {
        Height = Application.GetRealHeight(44),
        TextAlignment = TextAlignment.Center,
        TextColor = CSS_Color.MainColor,
        TextSize = CSS_FontSize.SubheadingFontSize,
        TextID = StringId.On
      };
      optinView.AddChidren(btnOpen);
      optinView.AddChidren(new Button()
      {
        Height = 1,
        BackgroundColor = CSS_Color.DividingLineColor
      });
      Button btnClose = new Button()
      {
        Height = Application.GetRealHeight(44),
        TextAlignment = TextAlignment.Center,
        TextColor = CSS_Color.PromptingColor1,
        TextID = StringId.OFF,
        TextSize = CSS_FontSize.SubheadingFontSize,
      };
      optinView.AddChidren(btnClose);
      Button btnCancel = new Button()
      {
        Gravity = Gravity.CenterHorizontal,
        Y = optinView.Bottom + Application.GetRealHeight(8),
        Width = Application.GetRealWidth(343),
        Height = Application.GetRealHeight(44),
        Radius = (uint)Application.GetRealHeight(13),
        BackgroundColor = CSS_Color.MainBackgroundColor,
        TextID = StringId.Cancel,
        TextColor = CSS_Color.WarningColor,
        IsBold = true,
      };
      contentView.AddChidren(btnCancel);
      dialog.Show();
        // <summary>
        /// 显示功能Row
        /// </summary>
        void LoadFunctionListRow(List<Function> functions)
        {
            functionListView.RemoveAll();
            if (functions == null)
            {
                functions = allocatedList;
            }
            foreach (var function in functions)
            {
                var output = securityAlarm.output.Find((obj) => obj.sid == function.sid);
                if (output == null)
                {
                    output = new SecurityOutput();
                    output.sid = function.sid;
                }
                else
                {
                    output.addCondition = true;
                }
                outputList.Add(output);
                FrameLayout functionRow = new FrameLayout()
                {
                    Height = Application.GetRealHeight(65),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                functionListView.AddChidren(functionRow);
                var btnFunctionName = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(200),
                    Height = Application.GetRealHeight(44),
                    Text = function.name,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                functionRow.AddChidren(btnFunctionName);
                var btnFunctionFloorName = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Y = Application.GetRealHeight(24),
                    Width = Application.GetRealWidth(200),
                    Height = Application.GetRealHeight(41),
                    Text = function.GetRoomListName(),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                };
                functionRow.AddChidren(btnFunctionFloorName);
                Button btnState = new Button()
                {
                    Width = Application.GetRealWidth(317),
                    TextAlignment = TextAlignment.CenterRight,
                    TextSize = CSS_FontSize.TextFontSize,
                    TextColor = CSS_Color.PromptingColor1,
                };
                functionRow.AddChidren(btnState);
                Button btnChooseIcon = new Button()
                {
                    X = Application.GetRealWidth(333),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(32),
                    Height = Application.GetMinRealAverage(32),
                    UnSelectedImagePath = "Public/ChooseIcon.png",
                    SelectedImagePath = "Public/ChooseOnIcon.png",
                };
                functionRow.AddChidren(btnChooseIcon);
                btnChooseIcon.MouseUpEventHandler = (sender, e) => {
                    btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected;
                    if (btnChooseIcon.IsSelected)
                    {
                        output.addCondition = true;
                        if (output.status.Count == 0)
                        {
                            ShowStateDialog(output, btnState,btnChooseIcon);
                        }
                    }
                    else
                    {
                        output.addCondition = false;
                    }
                };
                btnState.MouseUpEventHandler = (sender, e) =>
                {
                    ShowStateDialog(output, btnState, btnChooseIcon);
                };
                if (output.addCondition)
                {
                    btnChooseIcon.IsSelected = true;
                    btnState.Text = output.StateText();
                }
                functionListView.AddChidren(new Button()
                {
                    Gravity = Gravity.CenterHorizontal,
                    Width = Application.GetRealWidth(343),
                    Height = Application.GetRealWidth(1),
                    BackgroundColor = CSS_Color.DividingLineColor,
                });
            }
        }
        private void ShowStateDialog(SecurityOutput output, Button btnState, Button btnChoose = null)
        {
            Dialog dialog = new Dialog();
            FrameLayout contentView = new FrameLayout();
            dialog.AddChidren(contentView);
            contentView.MouseUpEventHandler = (sender, e) =>
            {
                dialog.Close();
                if (output.status.Count == 0)
                {
                    if (btnChoose != null)
                    {
                        btnChoose.IsSelected = false;
                    }
                }
            };
            VerticalScrolViewLayout optinView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(515),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(88),
                Radius = (uint)Application.GetRealHeight(13),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            contentView.AddChidren(optinView);
            Button btnOpen = new Button()
            {
                Height = Application.GetRealHeight(44),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.On
            };
            optinView.AddChidren(btnOpen);
            optinView.AddChidren(new Button()
            {
                Height = 1,
                BackgroundColor = CSS_Color.DividingLineColor
            });
            Button btnClose = new Button()
            {
                Height = Application.GetRealHeight(44),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor1,
                TextID = StringId.OFF,
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            optinView.AddChidren(btnClose);
            Button btnCancel = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = optinView.Bottom + Application.GetRealHeight(8),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(44),
                Radius = (uint)Application.GetRealHeight(13),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                TextID = StringId.Cancel,
                TextColor = CSS_Color.WarningColor,
                IsBold = true,
            };
            contentView.AddChidren(btnCancel);
            dialog.Show();
            btnOpen.MouseUpEventHandler = (sender, e) => {
                btnState.Text = btnOpen.Text;
                output.status = new List<SecurityOutputStatus>()
      btnOpen.MouseUpEventHandler = (sender, e) =>
      {
        btnState.Text = btnOpen.Text;
        output.status = new List<SecurityOutputStatus>()
                {
                    new SecurityOutputStatus()
                    {
@@ -369,73 +371,73 @@
                        value = "on",
                    }
                };
                output.addCondition = true;
                if (btnChoose != null)
                {
                    btnChoose.IsSelected = true;
                }
                dialog.Close();
            };
        output.addCondition = true;
        if (btnChoose != null)
        {
          btnChoose.IsSelected = true;
        }
        dialog.Close();
      };
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
                btnState.Text = btnClose.Text;
                output.status = new List<SecurityOutputStatus>()
                {
      btnClose.MouseUpEventHandler = (sender, e) =>
      {
        btnState.Text = btnClose.Text;
        output.status = new List<SecurityOutputStatus>()
          {
                    new SecurityOutputStatus()
                    {
                        key = FunctionAttributeKey.OnOff,
                        value = "off",
                    }
                };
                output.addCondition = true;
                if (btnChoose != null)
                {
                    btnChoose.IsSelected = true;
                }
                dialog.Close();
            };
            btnCancel.MouseUpEventHandler = (sender, e) =>
            {
                dialog.Close();
                if (output.status.Count == 0)
                {
                    if (btnChoose != null)
                    {
                        btnChoose.IsSelected = false;
                    }
                }
            };
        }
        /// <summary>
        /// 住宅列表点击事件
        /// </summary>
        void LoadDialog_ChangeFloor()
          };
        output.addCondition = true;
        if (btnChoose != null)
        {
            string nowSelectId = null;
            btnFloor.MouseUpEventHandler += (sender, e) =>
            {
                var listAllFun = new List<Function>();
                listAllFun.AddRange(allocatedList);
          btnChoose.IsSelected = true;
        }
        dialog.Close();
      };
                //显示下拉界面
                var form = new FloorRoomSelectPopupView();
                form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) =>
                {
                    nowSelectId = selectId;
                    //重新刷新设备列表
                    this.LoadFunctionListRow(listFun);
                }, nowSelectId);
            };
      btnCancel.MouseUpEventHandler = (sender, e) =>
      {
        dialog.Close();
        if (output.status.Count == 0)
        {
          if (btnChoose != null)
          {
            btnChoose.IsSelected = false;
          }
        }
      };
    }
    /// <summary>
    /// 住宅列表点击事件
    /// </summary>
    void LoadDialog_ChangeFloor()
    {
      string nowSelectId = null;
      btnFloor.MouseUpEventHandler += (sender, e) =>
      {
        var listAllFun = new List<Function>();
        listAllFun.AddRange(allocatedList);
              //显示下拉界面
              var form = new FloorRoomSelectPopupView();
        form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) =>
              {
            nowSelectId = selectId;
                  //重新刷新设备列表
                  this.LoadFunctionListRow(listFun);
          }, nowSelectId);
      };
    }
  }
}