LeftCardControl.xaml.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. using DraggAnimatedPanelExample;
  2. using GeekDesk.Constant;
  3. using GeekDesk.Control.Other;
  4. using GeekDesk.Control.Windows;
  5. using GeekDesk.Util;
  6. using GeekDesk.ViewModel;
  7. using System;
  8. using System.Collections.ObjectModel;
  9. using System.Threading;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. namespace GeekDesk.Control.UserControls.PannelCard
  15. {
  16. /// <summary>
  17. /// LeftCardControl.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class LeftCardControl : UserControl
  20. {
  21. private int menuSelectIndexTemp = -1;
  22. private AppData appData = MainWindow.appData;
  23. private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
  24. public LeftCardControl()
  25. {
  26. InitializeComponent();
  27. this.Loaded += (s, e) =>
  28. {
  29. SelectLastMenu();
  30. SetMenuListBoxItemEvent();
  31. };
  32. }
  33. private void SetMenuListBoxItemEvent()
  34. {
  35. int size = MenuListBox.Items.Count;
  36. for (int i = 0; i < size; i++)
  37. {
  38. ListBoxItem lbi = (ListBoxItem)(MenuListBox.ItemContainerGenerator.ContainerFromIndex(i));
  39. if (lbi != null)
  40. {
  41. SetListBoxItemEvent(lbi);
  42. }
  43. }
  44. //首次触发不了Selected事件
  45. object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
  46. Lbi_Selected(obj, null);
  47. }
  48. private void SetListBoxItemEvent(ListBoxItem lbi)
  49. {
  50. lbi.MouseEnter += (s, me) =>
  51. {
  52. lbi.Background = bac;
  53. };
  54. lbi.Unselected += Lbi_Unselected;
  55. lbi.MouseLeave += Lbi_MouseLeave;
  56. lbi.Selected += Lbi_Selected;
  57. }
  58. private void SelectLastMenu()
  59. {
  60. if (appData.AppConfig.SelectedMenuIndex >= appData.MenuList.Count || appData.AppConfig.SelectedMenuIndex == -1)
  61. {
  62. MenuListBox.SelectedIndex = 0;
  63. appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
  64. appData.AppConfig.SelectedMenuIcons = appData.MenuList[0].IconList;
  65. }
  66. else
  67. {
  68. MenuListBox.SelectedIndex = appData.AppConfig.SelectedMenuIndex;
  69. appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
  70. }
  71. }
  72. DelegateCommand<int[]> _swap;
  73. public DelegateCommand<int[]> SwapCommand
  74. {
  75. get
  76. {
  77. if (_swap == null)
  78. _swap = new DelegateCommand<int[]>(
  79. (indexes) =>
  80. {
  81. int fromS = indexes[0];
  82. int to = indexes[1];
  83. ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
  84. var elementSource = menuList[to];
  85. var dragged = menuList[fromS];
  86. menuList.Remove(dragged);
  87. menuList.Insert(to, dragged);
  88. MenuListBox.SelectedIndex = to;
  89. MainWindow.appData.MenuList = menuList;
  90. }
  91. );
  92. return _swap;
  93. }
  94. }
  95. /// <summary>
  96. /// 当修改菜单元素可见时 设置原菜单为不可见 并且不可选中
  97. /// 修改菜单元素不可见时 原菜单可见 并 选中
  98. /// </summary>
  99. /// <param name="sender"></param>
  100. /// <param name="e"></param>
  101. private void MenuWhenVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e)
  102. {
  103. StackPanel sp = sender as StackPanel;
  104. ListBoxItem lbi = (sp.TemplatedParent as ContentPresenter).TemplatedParent as ListBoxItem;
  105. if (sp.Visibility == Visibility.Collapsed)
  106. {
  107. lbi.MouseEnter += Lbi_MouseEnter;
  108. if (MenuListBox.SelectedIndex != -1)
  109. {
  110. menuSelectIndexTemp = MenuListBox.SelectedIndex;
  111. MenuListBox.SelectedIndex = -1;
  112. }
  113. else
  114. {
  115. MenuListBox.SelectedIndex = menuSelectIndexTemp;
  116. }
  117. }
  118. else
  119. {
  120. lbi.MouseEnter += (s, me) =>
  121. {
  122. lbi.Background = bac;
  123. };
  124. lbi.MouseLeave += Lbi_MouseLeave;
  125. lbi.Selected += Lbi_Selected;
  126. }
  127. }
  128. #region 设置菜单触发事件
  129. private void Lbi_MouseEnter(object sender, MouseEventArgs e)
  130. {
  131. ListBoxItem lbi = sender as ListBoxItem;
  132. lbi.Background = Brushes.Transparent;
  133. }
  134. private void Lbi_Unselected(object sender, RoutedEventArgs e)
  135. {
  136. //添加Leave效果
  137. ListBoxItem lbi = sender as ListBoxItem;
  138. lbi.Background = Brushes.Transparent;
  139. lbi.MouseLeave += Lbi_MouseLeave;
  140. }
  141. private void Lbi_Selected(object sender, RoutedEventArgs e)
  142. {
  143. try
  144. {
  145. ListBoxItem lbi = sender as ListBoxItem;
  146. SolidColorBrush fontColor = new SolidColorBrush(Colors.Black);
  147. lbi.MouseLeave -= Lbi_MouseLeave;
  148. lbi.Background = bac;
  149. lbi.Foreground = fontColor;
  150. }
  151. catch { }
  152. }
  153. private void Lbi_MouseLeave(object sender, MouseEventArgs e)
  154. {
  155. ListBoxItem lbi = sender as ListBoxItem;
  156. lbi.Background = Brushes.Transparent;
  157. }
  158. #endregion
  159. /// <summary>
  160. /// 新建菜单
  161. /// </summary>
  162. /// <param name="sender"></param>
  163. /// <param name="e"></param>
  164. private void CreateMenu(object sender, RoutedEventArgs e)
  165. {
  166. MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu" };
  167. appData.MenuList.Add(info);
  168. MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
  169. appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
  170. appData.AppConfig.SelectedMenuIcons = info.IconList;
  171. //首次触发不了Selected事件
  172. object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
  173. SetListBoxItemEvent((ListBoxItem)obj);
  174. Lbi_Selected(obj, null);
  175. }
  176. /// <summary>
  177. /// 重命名菜单 将textbox 设置为可见
  178. /// </summary>
  179. /// <param name="sender"></param>
  180. /// <param name="e"></param>
  181. private void RenameMenu(object sender, RoutedEventArgs e)
  182. {
  183. RunTimeStatus.IS_MENU_EDIT = true;
  184. MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
  185. menuInfo.MenuEdit = (int)Visibility.Visible;
  186. }
  187. /// <summary>
  188. /// 删除菜单
  189. /// </summary>
  190. /// <param name="sender"></param>
  191. /// <param name="e"></param>
  192. private void DeleteMenu(object sender, RoutedEventArgs e)
  193. {
  194. HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
  195. {
  196. if (isConfirmed)
  197. {
  198. MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
  199. if (appData.MenuList.Count == 1)
  200. {
  201. //如果删除以后没有菜单的话 先创建一个
  202. CreateMenu(null, null);
  203. }
  204. int index = appData.MenuList.IndexOf(menuInfo);
  205. if (index == 0)
  206. {
  207. index = 0;
  208. }
  209. else
  210. {
  211. index--;
  212. }
  213. appData.MenuList.Remove(menuInfo);
  214. // 选中下一个菜单
  215. MenuListBox.SelectedIndex = index;
  216. appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
  217. appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
  218. }
  219. return true;
  220. }, "MainWindowAskGrowl");
  221. }
  222. /// <summary>
  223. /// 编辑菜单失焦或者敲下Enter键时保存修改后的菜单
  224. /// </summary>
  225. /// <param name="sender"></param>
  226. /// <param name="e"></param>
  227. private void LostFocusOrEnterDown(object sender, EventArgs e)
  228. {
  229. bool done = true;
  230. TextBox menuBox = null;
  231. if (e.GetType() == typeof(KeyEventArgs))
  232. {
  233. KeyEventArgs eKey = e as KeyEventArgs;
  234. if (eKey.Key == Key.Enter)
  235. {
  236. menuBox = ((TextBox)sender);
  237. }
  238. else
  239. {
  240. done = false;
  241. }
  242. }
  243. else if (e.GetType() == typeof(RoutedEventArgs))
  244. {
  245. menuBox = ((TextBox)sender);
  246. }
  247. if (done)
  248. {
  249. if (menuBox != null)
  250. {
  251. MenuInfo menuInfo = menuBox.Tag as MenuInfo;
  252. string text = menuBox.Text;
  253. menuInfo.MenuName = text;
  254. menuInfo.MenuEdit = Visibility.Collapsed;
  255. }
  256. RunTimeStatus.IS_MENU_EDIT = false;
  257. //为了解决无法修改菜单的问题
  258. MainWindow.mainWindow.SearchBox.Focus();
  259. MenuListBox.SelectedIndex = menuSelectIndexTemp;
  260. }
  261. }
  262. /// <summary>
  263. /// 当修改菜单元素可见时 设置全选并获得焦点
  264. /// </summary>
  265. /// <param name="sender"></param>
  266. /// <param name="e"></param>
  267. private void MenuEditWhenVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e)
  268. {
  269. TextBox box = sender as TextBox;
  270. MenuInfo mi = box.Tag as MenuInfo;
  271. if (box.Visibility == Visibility.Visible)
  272. {
  273. Keyboard.Focus(box);
  274. box.SelectAll();
  275. }
  276. }
  277. /// <summary>
  278. /// 修改菜单图标
  279. /// </summary>
  280. /// <param name="sender"></param>
  281. /// <param name="e"></param>
  282. private void EditMenuGeometry(object sender, RoutedEventArgs e)
  283. {
  284. MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
  285. IconfontWindow.Show(SvgToGeometry.GetIconfonts(), menuInfo);
  286. }
  287. private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
  288. {
  289. if (RunTimeStatus.IS_MENU_EDIT) return;
  290. if (appData.AppConfig.ItemSpradeAnimation)
  291. {
  292. //是否启用列表展开动画
  293. MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed;
  294. }
  295. //设置对应菜单的图标列表
  296. if (MenuListBox.SelectedIndex == -1)
  297. {
  298. //appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.MenuList.Count - 1].IconList;
  299. }
  300. else
  301. {
  302. if (appData.MenuList[MenuListBox.SelectedIndex].IsEncrypt)
  303. {
  304. appData.AppConfig.SelectedMenuIcons = null;
  305. RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
  306. MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
  307. MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.INPUT;
  308. MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
  309. }
  310. else
  311. {
  312. MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
  313. appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
  314. }
  315. }
  316. MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
  317. //App.DoEvents();
  318. }
  319. /// <summary>
  320. /// 鼠标悬停切换菜单
  321. /// </summary>
  322. /// <param name="sender"></param>
  323. /// <param name="e"></param>
  324. private void Menu_MouseEnter(object sender, MouseEventArgs e)
  325. {
  326. if (appData.AppConfig.HoverMenu && !RunTimeStatus.IS_MENU_EDIT)
  327. {
  328. Thread t = new Thread(() =>
  329. {
  330. Thread.Sleep(200);
  331. this.Dispatcher.Invoke(() =>
  332. {
  333. ListBoxItem lbi = sender as ListBoxItem;
  334. if (lbi.IsMouseOver)
  335. {
  336. int index = MenuListBox.ItemContainerGenerator.IndexFromContainer(lbi);
  337. MenuListBox.SelectedIndex = index;
  338. }
  339. });
  340. });
  341. t.IsBackground = true;
  342. t.Start();
  343. }
  344. }
  345. /// <summary>
  346. /// 点击菜单后 隐藏搜索框
  347. /// </summary>
  348. /// <param name="sender"></param>
  349. /// <param name="e"></param>
  350. private void ListBoxItem_MouseDown(object sender, MouseButtonEventArgs e)
  351. {
  352. if (RunTimeStatus.SEARCH_BOX_SHOW)
  353. {
  354. MainWindow.mainWindow.HidedSearchBox();
  355. }
  356. ListBoxItem lbi = sender as ListBoxItem;
  357. MenuInfo mi = lbi.DataContext as MenuInfo;
  358. int index = MenuListBox.Items.IndexOf(mi);
  359. MenuListBox.SelectedIndex = index;
  360. }
  361. ///// <summary>
  362. ///// 点击菜单后 隐藏搜索框
  363. ///// </summary>
  364. ///// <param name="sender"></param>
  365. ///// <param name="e"></param>
  366. //private void ListBoxItemPanel_MouseDown(object sender, MouseButtonEventArgs e)
  367. //{
  368. // if (RunTimeStatus.SEARCH_BOX_SHOW)
  369. // {
  370. // MainWindow.mainWindow.HidedSearchBox();
  371. // }
  372. // MenuInfo mi = (sender as StackPanel).Tag as MenuInfo;
  373. // int index = MenuListBox.Items.IndexOf(mi);
  374. // MenuListBox.SelectedIndex = index;
  375. //}
  376. /// <summary>
  377. /// 隐藏搜索框
  378. /// </summary>
  379. /// <param name="sender"></param>
  380. /// <param name="e"></param>
  381. private void MyCard_MouseDown(object sender, MouseButtonEventArgs e)
  382. {
  383. if (RunTimeStatus.SEARCH_BOX_SHOW)
  384. {
  385. MainWindow.mainWindow.HidedSearchBox();
  386. }
  387. }
  388. private void Menu_MouseWheel(object sender, MouseWheelEventArgs e)
  389. {
  390. if (RunTimeStatus.IS_MENU_EDIT) return;
  391. ScrollViewer scrollViewer = ScrollUtil.FindSimpleVisualChild<ScrollViewer>(MenuListBox);
  392. if (e.Delta < 0)
  393. {
  394. //判断是否到了最底部
  395. if (ScrollUtil.IsBootomScrollView(scrollViewer))
  396. {
  397. int index = MenuListBox.SelectedIndex;
  398. if (index < MenuListBox.Items.Count - 1)
  399. {
  400. index++;
  401. }
  402. else
  403. {
  404. index = 0;
  405. }
  406. MenuListBox.SelectedIndex = index;
  407. }
  408. }
  409. else if (e.Delta > 0)
  410. {
  411. if (ScrollUtil.IsTopScrollView(scrollViewer))
  412. {
  413. int index = MenuListBox.SelectedIndex;
  414. if (index > 0)
  415. {
  416. index--;
  417. }
  418. else
  419. {
  420. index = MenuListBox.Items.Count - 1;
  421. }
  422. MenuListBox.SelectedIndex = index;
  423. }
  424. }
  425. //滚动到选中项
  426. MenuListBox.ScrollIntoView(MenuListBox.SelectedItem);
  427. }
  428. private void Menu_PreviewDragLeave(object sender, DragEventArgs e)
  429. {
  430. MyPoptip.IsOpen = false;
  431. }
  432. private void Menu_PreviewDragEnter(object sender, DragEventArgs e)
  433. {
  434. MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
  435. MyPoptipContent.Text = "移动至:" + mi.MenuName;
  436. MyPoptip.VerticalOffset = 30;
  437. MyPoptip.IsOpen = true;
  438. }
  439. private void Menu_MouseLeave(object sender, MouseEventArgs e)
  440. {
  441. MyPoptip.IsOpen = false;
  442. }
  443. /// <summary>
  444. /// 拖动移动图标到指定菜单
  445. /// </summary>
  446. /// <param name="sender"></param>
  447. /// <param name="e"></param>
  448. private void Menu_Drop(object sender, DragEventArgs e)
  449. {
  450. MyPoptip.IsOpen = false;
  451. MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
  452. IconInfo iconInfo = (IconInfo)e.Data.GetData(typeof(IconInfo));
  453. if (iconInfo != null)
  454. {
  455. // 将已有图标移动到该菜单
  456. appData.MenuList[MenuListBox.SelectedIndex].IconList.Remove(iconInfo);
  457. appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
  458. }
  459. else
  460. {
  461. // 直接将新图标移动到该菜单
  462. Array dropObject = (System.Array)e.Data.GetData(DataFormats.FileDrop);
  463. if (dropObject == null) return;
  464. foreach (object obj in dropObject)
  465. {
  466. string path = (string)obj;
  467. iconInfo = CommonCode.GetIconInfoByPath(path);
  468. if (iconInfo == null)
  469. {
  470. LogUtil.WriteErrorLog("添加项目失败,未能获取到项目图标:" + path);
  471. break;
  472. }
  473. appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
  474. }
  475. CommonCode.SortIconList();
  476. CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
  477. }
  478. }
  479. private void EncryptMenu(object sender, RoutedEventArgs e)
  480. {
  481. MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
  482. if (menuInfo.IsEncrypt)
  483. {
  484. MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
  485. MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
  486. MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CANCEL;
  487. RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
  488. MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
  489. //单独设置焦点
  490. MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
  491. }
  492. else
  493. {
  494. if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
  495. {
  496. MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
  497. MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "设置新密码";
  498. MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CREATE;
  499. RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
  500. MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
  501. }
  502. else
  503. {
  504. menuInfo.IsEncrypt = true;
  505. HandyControl.Controls.Growl.Success(menuInfo.MenuName + " 已加密!", "MainWindowGrowl");
  506. }
  507. }
  508. }
  509. private void AlterPassword(object sender, RoutedEventArgs e)
  510. {
  511. MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入旧密码";
  512. MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.ALTER;
  513. MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
  514. //单独设置焦点
  515. MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
  516. }
  517. /// <summary>
  518. /// 右键点击进行处理
  519. /// </summary>
  520. /// <param name="sender"></param>
  521. /// <param name="e"></param>
  522. private void MyCard_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
  523. {
  524. RunTimeStatus.SHOW_RIGHT_BTN_MENU = true;
  525. new Thread(() =>
  526. {
  527. Thread.Sleep(50);
  528. RunTimeStatus.SHOW_RIGHT_BTN_MENU = false;
  529. }).Start();
  530. //在没有设置密码的情况下不弹出修改密码菜单
  531. if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
  532. {
  533. AlterPW1.Visibility = Visibility.Collapsed;
  534. }
  535. else
  536. {
  537. AlterPW1.Visibility = Visibility.Visible;
  538. }
  539. }
  540. private void ListBoxItem_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
  541. {
  542. ListBoxItem lbi = sender as ListBoxItem;
  543. MenuInfo info = lbi.DataContext as MenuInfo;
  544. ItemCollection ics = lbi.ContextMenu.Items;
  545. foreach (object obj in ics)
  546. {
  547. MenuItem mi = (MenuItem)obj;
  548. if (mi.Header.Equals("修改密码"))
  549. {
  550. if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
  551. {
  552. mi.Visibility = Visibility.Collapsed;
  553. }
  554. else
  555. {
  556. mi.Visibility = Visibility.Visible;
  557. }
  558. break;
  559. }
  560. if (mi.Header.Equals("加密此列表") || mi.Header.Equals("取消加密此列表"))
  561. {
  562. if (info.IsEncrypt)
  563. {
  564. mi.Header = "取消加密此列表";
  565. }
  566. else
  567. {
  568. mi.Header = "加密此列表";
  569. }
  570. }
  571. }
  572. }
  573. }
  574. }