From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期一, 14 十二月 2020 09:59:01 +0800 Subject: [PATCH] 请合并代码,完成晾衣架最终功能。 --- ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 170 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs new file mode 100644 index 0000000..6e2ceb4 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs @@ -0,0 +1,170 @@ +锘縰sing System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Shared.Phone.UserCenter.HideOption +{ + /// <summary> + /// 鏈湴缂撳瓨鏂囦欢澶瑰垪琛ㄧ殑鐣岄潰 + /// </summary> + public class HideOptionDirectoryListForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText("鏂囦欢澶瑰垪琛�"); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + var listView = new VerticalListControl(23); + listView.BackgroundColor = UserCenterColor.Current.White; + listView.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listView); + + Type type = typeof(DirNameResourse); + + var PropertyList = type.GetProperties(); + + var listFile = new List<System.Reflection.PropertyInfo>(); + foreach (var item in PropertyList) + { + if (item.Name.EndsWith("Directory") == true) + { + listFile.Add(item); + } + } + for (int i = 0; i < listFile.Count; i++) + { + var item = listFile[i]; + this.AddRowControl(listView, item.Name, item.GetValue(null).ToString(), true); + } + + //鏈湴鏂囦欢 + var row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption("鏍圭洰褰曟枃浠�", 800); + row1.AddRightArrow(); + row1.AddBottomLine(); + row1.ButtonClickEvent += (sender, e) => + { + 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)); + } + + private void AddRowControl(VerticalListControl listView, string directory, string directoryValue, bool addLine) + { + if (System.IO.Directory.Exists(directoryValue) == false) + { + return; + } + var row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption(directory, 800); + row1.AddRightArrow(); + if (addLine == true) + { + row1.AddBottomLine(); + } + + row1.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionSearchAllFile(); + form.AddForm(directoryValue); + }; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} -- Gitblit v1.8.0