WJC
2019-12-05 73e6bfcd3eed1b4aa714af538891a3a62864b516
2019-12-05-1

加上列表刷新操作
6个文件已修改
180 ■■■■ 已修改文件
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/Category.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,19 +1,28 @@
<Properties StartupConfiguration="{F1296E2C-3777-4385-85B2-DA77617E3178}|Default">
  <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Category/Category.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs">
    <Files>
      <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1" Column="1" />
      <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1908" Column="11" />
      <File FileName="Shared/Phone/Device/Logic/DeviceStateCondition.cs" Line="1435" Column="38" />
      <File FileName="Shared/Phone/Device/Logic/MemberList.cs" Line="122" Column="20" />
      <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="798" Column="37" />
      <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs" Line="1" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="GateWay" expanded="True">
            <Node name="Home.IOS" expanded="True" />
            <Node name="Shared" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="Phone" expanded="True">
                <Node name="Device" expanded="True">
                  <Node name="Category" expanded="True">
                    <Node name="Category.cs" selected="True" />
                  <Node name="Category" expanded="True" />
                  <Node name="Logic" expanded="True">
                    <Node name="DoorLockLogic" expanded="True">
                      <Node name="AddCondition.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -1740,9 +1740,9 @@
        #endregion
        #region ◆ 自动化__________________________
        /// <summary>
        /// 自动化
        /// 自动化功能代码入口
        /// </summary>
        private async void ShowAutotion()
        {
@@ -1758,7 +1758,7 @@
                Y = Application.GetRealHeight(30),
            };
            functionSceneAutoBodyView.AddChidren(bjFrameLayout);
            bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58),HDLUtils.RectCornerBottomLeft);
            bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
            var sigBtn = new Button
            {
                Width = Application.GetMinRealAverage(84),
@@ -1779,7 +1779,7 @@
                TextID = MyInternationalizationString.logictemplate,
                Gravity = Gravity.CenterVertical,
                TextColor = ZigbeeColor.Current.LogicBtnSelectedColor,
                TextSize=15,
                TextSize = 15,
            };
            bjFrameLayout.AddChidren(recommendtextBtn);
@@ -1804,7 +1804,7 @@
            };
            functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
            var logicScrolView = new VerticalScrolViewLayout
            var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
            {
                Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
@@ -1905,14 +1905,31 @@
                logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
                Automationview(logicScrolView);
            };
            logicScrolView.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                Common.Logic.LogicList.Clear();
                Read(logicScrolView);
                //关闭刷新View;
                logicScrolView.EndHeaderRefreshing();
            };
            Read(logicScrolView);
        }
        /// <summary>
        /// 读取自动化列表数据;
        /// </summary>
        /// <param name="logicScrolView"></param>
        private async void Read(VerticalRefreshLayout logicScrolView)
        {
            CommonPage.Loading.Start();
            if (Common.Logic.LogicList.Count == 0)
            {
                var Idlist = await Logic.Send.GetLogicId(0);
                if (Idlist.Count != 0)
                {
                    var listlogic = await Logic.Send.ReadList(Idlist.Count,0);
                    var listlogic = await Logic.Send.ReadList(Idlist.Count, 0);
                    //foreach可能集合已被修改,枚举操作可能不会执行,可能出现崩溃(建议for)。
                    for (int j = 0; j < listlogic.Count; j++)
                    {
@@ -1928,14 +1945,13 @@
            //自动化
            Automationview(logicScrolView);
            CommonPage.Loading.Hide();
        }
        }
        /// <summary>
        /// 自动化列表界面
        /// 加载自动化列表界面
        /// </summary>
        /// <param name="refresview">Refresview.</param>
        private async void Automationview(VerticalScrolViewLayout refresview)
        private async void Automationview(VerticalRefreshLayout refresview)
        {
            refresview.RemoveAll();
            foreach (var logic in Common.Logic.LogicList)
@@ -2064,7 +2080,7 @@
        }
        /// <summary>
        /// 显示图标的颜色
        /// 显示自动化输出功能模块图标的颜色
        /// </summary>
        /// <param name="logic"></param>
        /// <param name="logicRowlayout"></param>
@@ -2463,6 +2479,7 @@
                }
            }
        }
        #endregion
        #region ◆ 控制状态_________________________
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -12,10 +12,10 @@
            Tag = "LockLogic";
        }
        Button selectedIcon = new Button();
        VerticalScrolViewLayout middle;
        VerticalRefreshLayout middle;
        public int conditionsIndex = -1;
        public async void Show()
        public void Show()
        {
            #region  最上面的布局代码
            var topRowLayout = new RowLayout
@@ -69,14 +69,37 @@
            #endregion
            middle = new VerticalScrolViewLayout
            middle = new VerticalRefreshLayout
            {
                Y = topRowLayout.Bottom,
                Height = Application.GetRealHeight(1920 - 184),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
            middle.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString();
                for (int i = 0; i < Send.LockList.Count; i++)
                {
                    if (Send.LockList[i].DoorLockMacPort == macport)
                    {
                        ///从列表移除当前门锁全部的旧数据;
                        Send.LockList.Remove(Send.LockList[i]);
                    }
                }
                Read();
                //关闭刷新View;
                middle.EndHeaderRefreshing();
            };
            Read();
        }
        /// <summary>
        /// 读取当前门锁的云端数据;
        /// </summary>
        public async void Read()
        {
            bool d = false;
            string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString();
            for (int i = 0; i < Send.LockList.Count; i++)
@@ -96,12 +119,11 @@
            }
            UserAllView(macport);
            CommonPage.Loading.Hide();
        }
        /// <summary>
        /// 显示所有用户
        /// </summary>
        void UserAllView(string macport)
        public void UserAllView(string macport)
        {
            for (int i = 0; i < Send.LockList.Count; i++)
@@ -167,10 +189,10 @@
        /// 选择某个用户
        /// </summary>
        /// <param name="membershipIfon">触发源列表</param>
        /// <param name="userName">用户名字</param>
        void SelectedUserID(Send.MembershipIfon membershipIfon) {
        public void SelectedUserID(Send.MembershipIfon membershipIfon)
        {
           var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
            this.AddChidren(flMain);
            flMain.MouseUpEventHandler += (sender1, e1) =>
@@ -178,7 +200,7 @@
                flMain.RemoveFromParent();
            };
            var lockcolorfra1 = new FrameLayout
            {
@@ -279,7 +301,7 @@
                    TextSize = 14,
                };
                doorlockRow.AddChidren(doorlockBtn);
                var doorlockSelected = new Button
                {
                    X = Application.GetRealWidth(860),
@@ -320,11 +342,11 @@
                        selectedIcon = doorlockSelected;
                        doorlockSelected.Visible = true;
                    }
                }
            }
            Btncomplete.MouseUpEventHandler += (sender, e) =>
            {
                var lockConditionsInfo = new Dictionary<string, string>();
@@ -339,7 +361,7 @@
                lockConditionsInfo.Add("Range", "0");
                var accounts = new Dictionary<string, string>();
                accounts.Add("Type", "1");
                accounts.Add("Account", membershipIfon.UserName+ modeName);
                accounts.Add("Account", membershipIfon.UserName + modeName);
                accounts.Add("UserId", attriButeData2);
                if (SelectedLockStatus != "")
                {
@@ -422,6 +444,6 @@
                lockLogicCommunalPage.Show(() => { });
            };
        }
    }
}
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -12,8 +12,8 @@
        {
            Tag = "LockLogicList";
        }
        VerticalScrolViewLayout middle;
        public async void Show()
        VerticalRefreshLayout middle;
        public void Show()
        {
            #region  最上面的布局代码
@@ -89,14 +89,29 @@
            };
            #endregion
            middle = new VerticalScrolViewLayout
            middle = new VerticalRefreshLayout
            {
                Y = topRowLayout.Bottom,
                Height = Application.GetRealHeight(1920 - 184),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
            middle.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                Common.Logic.LockLogicList.Clear();
                Read();
                //关闭刷新View;
                middle.EndHeaderRefreshing();
            };
            Read();
        }
        /// <summary>
        /// 读取自动化数据
        /// </summary>
        public async void Read()
        {
            CommonPage.Loading.Start();
            if (Common.Logic.LockLogicList.Count == 0)
            {
@@ -129,12 +144,13 @@
                    }
                }
            }
            //自动化
            Automationview();
            CommonPage.Loading.Hide();
        }
        void Automationview()
        /// <summary>
        /// 加载自动化列表的界面
        /// </summary>
        public void Automationview()
        {
            middle.RemoveAll();
            for (int i = 0; i < Common.Logic.LockLogicList.Count; i++)
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -15,12 +15,14 @@
        }
        Button selectedIcon = new Button();
        public static bool edit = false;
        VerticalScrolViewLayout middle;
        VerticalRefreshLayout middle;
        CommonDevice common;
        Dictionary<string, string> editdeviceConditionsInfo;
        public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo = null)
        public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null)
        {
            common = commondevice;
            editdeviceConditionsInfo = editdeviceConditions;
            UserView.HomePage.Instance.ScrollEnabled = false;
            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            #region  最上面的布局代码
@@ -73,14 +75,36 @@
            };
            #endregion
            middle = new VerticalScrolViewLayout
            middle = new VerticalRefreshLayout
            {
                Y = topRowLayout.Bottom,
                Height = Application.GetRealHeight(1920 - 184),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
            middle.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
                for (int i = 0; i < Send.LockList.Count; i++)
                {
                    if (Send.LockList[i].DoorLockMacPort == macport)
                    {
                        ///从列表移除当前门锁全部的旧数据;
                        Send.LockList.Remove(Send.LockList[i]);
                    }
                }
                Read();
                //关闭刷新View;
                middle.EndHeaderRefreshing();
            };
            Read();
        }
        /// <summary>
        /// 读取当前门锁的云端数据;
        /// </summary>
        public async void Read()
        {
            bool d = false;
            string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
@@ -100,14 +124,14 @@
                var allMemberslist = await Send.AllMembers(common.DeviceAddr);
                Send.LockList.AddRange(allMemberslist);
            }
            UserList(macport, common, editdeviceConditionsInfo);
            UserList(macport);
            CommonPage.Loading.Hide();
        }
        /// <summary>
        /// 成员列表的方法
        /// </summary>
        /// <param name="macport"></param>
        void UserList(string macport, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
        public void UserList(string macport)
        {
            foreach (var user in Send.LockList)
@@ -156,7 +180,7 @@
                EventHandler<MouseEventArgs> useridclick = (sender, e) =>
                {
                    User(user, common, editdeviceConditionsInfo);
                    User(user);
                };
                userBtn.MouseUpEventHandler += useridclick;
@@ -167,12 +191,12 @@
            }
        }
        }
        /// <summary>
        /// 当前成员信息的方法
        /// </summary>
        /// <param name="user"></param>
        void User(Send.MembershipIfon user, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
        public void User(Send.MembershipIfon user)
        {
            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
            this.AddChidren(flMain);