From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs |   90 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 77 insertions(+), 13 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
old mode 100755
new mode 100644
index cfdeb44..6e2ceb4
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 
 namespace Shared.Phone.UserCenter.HideOption
@@ -39,9 +40,9 @@
 
             Type type = typeof(DirNameResourse);
 
-            var PropertyList = type.GetFields();
+            var PropertyList = type.GetProperties();
 
-            var listFile = new List<System.Reflection.FieldInfo>();
+            var listFile = new List<System.Reflection.PropertyInfo>();
             foreach (var item in PropertyList)
             {
                 if (item.Name.EndsWith("Directory") == true)
@@ -60,11 +61,79 @@
             listView.AddChidren(row1);
             row1.AddLeftCaption("鏍圭洰褰曟枃浠�", 800);
             row1.AddRightArrow();
-
+            row1.AddBottomLine();
             row1.ButtonClickEvent += (sender, e) =>
             {
-                var form = new HideOptionFileListForm();
-                form.AddForm(UserCenterLogic.CombinePath());
+                var form = new HideOptionSearchAllFile();
+                form.AddForm(Common.Config.Instance.FullPath);
+            };
+
+#if iOS
+            //鏌ョ湅鍏ㄩ儴鏂囦欢
+            var row0 = new FrameRowControl(listView.rowSpace / 2);
+            listView.AddChidren(row0);
+            row0.AddLeftCaption("IOS鍥剧墖", 800);
+            row0.AddRightArrow();
+            row0.AddBottomLine();
+
+            row0.ButtonClickEvent += (sender, e) =>
+            {
+                string fileName = "Item/Add.png";
+                if (File.Exists(Path.Combine(Application.RootPath, fileName)))
+                {
+                    var form = new HideOptionSearchAllFile();
+                    form.AddForm(Application.RootPath);
+                    return;
+                }
+
+                string dirPath = string.Empty;
+                if (Application.Skin != null)
+                {
+                    dirPath = Application.Skin + "/" + fileName;
+                    if (File.Exists(Path.Combine(Application.RootPath, dirPath)))
+                    {
+                        var form = new HideOptionSearchAllFile();
+                        form.AddForm(Path.Combine(Application.RootPath, Application.Skin + "/"));
+                        return;
+                    }
+                    string text2 = Foundation.NSBundle.MainBundle.PathForResource(dirPath, null);
+                    if (text2 != null)
+                    {
+                        var form = new HideOptionSearchAllFile();
+                        form.AddForm(text2.Replace(dirPath, string.Empty));
+                        return;
+                    }
+                }
+                else
+                {
+                    dirPath = "Phone/" + fileName;
+                    if (File.Exists(Path.Combine(Application.RootPath, dirPath)))
+                    {
+                        var form = new HideOptionSearchAllFile();
+                        form.AddForm(Path.Combine(Application.RootPath, "Phone/"));
+                        return;
+                    }
+                    string text2 = Foundation.NSBundle.MainBundle.PathForResource(dirPath, null);
+                    if (text2 != null)
+                    {
+                        var form = new HideOptionSearchAllFile();
+                        form.AddForm(text2.Replace(dirPath, string.Empty));
+                        return;
+                    }
+                }
+            };
+#endif
+
+            //鏌ョ湅鍏ㄩ儴鏂囦欢
+            var row2 = new FrameRowControl(listView.rowSpace / 2);
+            listView.AddChidren(row2);
+            row2.AddLeftCaption("鏌ョ湅鍏ㄩ儴鏂囦欢", 800);
+            row2.AddRightArrow();
+
+            row2.ButtonClickEvent += (sender, e) =>
+            {
+                var form = new HideOptionSearchAllFile();
+                form.AddForm(Shared.IO.FileUtils.RootPath);
             };
 
             listView.AdjustRealHeight(Application.GetRealHeight(23));
@@ -72,12 +141,7 @@
 
         private void AddRowControl(VerticalListControl listView, string directory, string directoryValue, bool addLine)
         {
-            string myPath = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, directoryValue);
-            if (directoryValue == DirNameResourse.LocalMemoryDirectory)
-            {
-                myPath = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory);
-            }
-            if (System.IO.Directory.Exists(myPath) == false)
+            if (System.IO.Directory.Exists(directoryValue) == false)
             {
                 return;
             }
@@ -92,8 +156,8 @@
 
             row1.ButtonClickEvent += (sender, e) =>
             {
-                var form = new HideOptionFileListForm();
-                form.AddForm(myPath);
+                var form = new HideOptionSearchAllFile();
+                form.AddForm(directoryValue);
             };
         }
 

--
Gitblit v1.8.0