diff --git a/Constant/MenuTypeEnum.cs b/Constant/MenuTypeEnum.cs
deleted file mode 100644
index f0c43b9..0000000
--- a/Constant/MenuTypeEnum.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace GeekDesk.Constant
-{
- public enum MenuTypeEnum
- {
- NORMAL = 0,
- RELATION_FOLDER = 1
- }
-}
\ No newline at end of file
diff --git a/Control/Other/PasswordDialog.xaml.cs b/Control/Other/PasswordDialog.xaml.cs
index 27c2437..c6139ac 100644
--- a/Control/Other/PasswordDialog.xaml.cs
+++ b/Control/Other/PasswordDialog.xaml.cs
@@ -90,7 +90,6 @@ namespace GeekDesk.Control.Other
= appData.MenuList[
MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex
].IconList;
- MainWindow.mainWindow.LeftCard.BuildWatcher();
//显示数据托盘
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
//取消加密操作
diff --git a/Control/UserControls/Config/ThemeControl.xaml b/Control/UserControls/Config/ThemeControl.xaml
index 7114026..0159ffc 100644
--- a/Control/UserControls/Config/ThemeControl.xaml
+++ b/Control/UserControls/Config/ThemeControl.xaml
@@ -234,20 +234,6 @@
-
-
-
-
-
-
-
-
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml b/Control/UserControls/PannelCard/LeftCardControl.xaml
index fd47701..4d2a4df 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml
@@ -139,7 +139,6 @@
-
@@ -159,7 +158,6 @@
-
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
index 23a7675..6a8a89d 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
@@ -7,19 +7,11 @@ using GeekDesk.ViewModel;
using System;
using System.Collections.ObjectModel;
-using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
-using DragEventArgs = System.Windows.DragEventArgs;
-using KeyEventArgs = System.Windows.Input.KeyEventArgs;
-using MenuItem = System.Windows.Controls.MenuItem;
-using MouseEventArgs = System.Windows.Input.MouseEventArgs;
-using TextBox = System.Windows.Controls.TextBox;
-using UserControl = System.Windows.Controls.UserControl;
namespace GeekDesk.Control.UserControls.PannelCard
{
@@ -31,7 +23,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
private int menuSelectIndexTemp = -1;
private AppData appData = MainWindow.appData;
private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
- private FileSystemWatcher Watcher = new FileSystemWatcher();
public LeftCardControl()
@@ -43,33 +34,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
SelectLastMenu();
SetMenuListBoxItemEvent();
- BindWatcherEvent();
- BuildWatcher();
};
}
- private void BindWatcherEvent()
- {
- Watcher.Created += WatcherEvent;
- Watcher.Renamed += WatcherEvent;
- Watcher.Deleted += WatcherEvent;
- }
-
- public void BuildWatcher()
- {
- MenuInfo menuInfo = appData.MenuList[appData.AppConfig.SelectedMenuIndex];
- if (menuInfo.MenuType == MenuTypeEnum.RELATION_FOLDER)
- {
- Watcher.Path = menuInfo.RelationPath;
- }
- Watcher.EnableRaisingEvents = menuInfo.MenuType == MenuTypeEnum.RELATION_FOLDER;
- }
-
- private void WatcherEvent(object sender, EventArgs e)
- {
- MenuInfo menuInfo = appData.MenuList[appData.AppConfig.SelectedMenuIndex];
- appData.AppConfig.SelectedMenuIcons = menuInfo.IconList;
- }
private void SetMenuListBoxItemEvent()
{
@@ -222,7 +189,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
///
private void CreateMenu(object sender, RoutedEventArgs e)
{
- MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu", MenuType = MenuTypeEnum.NORMAL};
+ MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu" };
appData.MenuList.Add(info);
MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
@@ -374,7 +341,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
- BuildWatcher();
}
}
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
@@ -662,34 +628,5 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
}
-
- ///
- /// 创建关联文件夹的菜单
- ///
- ///
- ///
- private void CreateFolderMenu(object sender, RoutedEventArgs e)
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.RootFolder = Environment.SpecialFolder.Desktop;
- if (dialog.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(dialog.SelectedPath))
- {
- MenuInfo info = new MenuInfo()
- {
- MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = new DirectoryInfo(dialog.SelectedPath).Name,
-
- MenuType = MenuTypeEnum.RELATION_FOLDER, RelationPath = dialog.SelectedPath
- };
-
- appData.MenuList.Add(info);
- MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
- appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
- appData.AppConfig.SelectedMenuIcons = info.IconList;
- //首次触发不了Selected事件
- object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
- SetListBoxItemEvent((ListBoxItem)obj);
- Lbi_Selected(obj, null);
- }
- }
}
}
diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml
index 488f781..480bd9f 100644
--- a/Control/UserControls/PannelCard/RightCardControl.xaml
+++ b/Control/UserControls/PannelCard/RightCardControl.xaml
@@ -207,7 +207,7 @@
-
+
diff --git a/GeekDesk.csproj b/GeekDesk.csproj
index 29a9e63..bb2cde1 100644
--- a/GeekDesk.csproj
+++ b/GeekDesk.csproj
@@ -167,7 +167,6 @@
-
diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs
index 94c7dc5..c547050 100644
--- a/ViewModel/AppConfig.cs
+++ b/ViewModel/AppConfig.cs
@@ -105,27 +105,8 @@ namespace GeekDesk.ViewModel
private bool? secondsWindow; //秒数窗口 默认打开
- private string filterExt = "lnk|exe|cmd|vbs|bat|xls|xlsx|doc|docx|txt|pdf";
-
#region GetSet
- public string FilterExt
- {
- get
- {
- if (string.IsNullOrEmpty(filterExt))
- {
- FilterExt = "lnk|exe|cmd|vbs|bat|xls|xlsx|doc|docx|txt|pdf";
- }
- return filterExt;
- }
- set
- {
- filterExt = value;
- OnPropertyChanged("FilterExt");
- }
- }
-
public bool? SecondsWindow
{
get
diff --git a/ViewModel/MenuInfo.cs b/ViewModel/MenuInfo.cs
index 5585b42..243604b 100644
--- a/ViewModel/MenuInfo.cs
+++ b/ViewModel/MenuInfo.cs
@@ -3,8 +3,6 @@ using GeekDesk.Util;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
-using System.IO;
-using System.Linq;
using System.Windows;
namespace GeekDesk.ViewModel
@@ -17,8 +15,6 @@ namespace GeekDesk.ViewModel
private string menuName;
private string menuId;
- private MenuTypeEnum menuType = MenuTypeEnum.NORMAL;
- private string relationPath;
private Visibility menuEdit = Visibility.Collapsed;
private Visibility notMenuEdit = Visibility.Visible;
private string menuGeometry; //菜单几何图标
@@ -26,25 +22,6 @@ namespace GeekDesk.ViewModel
private ObservableCollection iconList = new ObservableCollection();
private bool isEncrypt; //是否加密
- public string RelationPath
- {
- get => relationPath;
- set
- {
- relationPath = value;
- OnPropertyChanged("RelationPath");
- }
- }
-
- public MenuTypeEnum MenuType
- {
- get => menuType;
- set
- {
- menuType = value;
- OnPropertyChanged("MenuType");
- }
- }
public bool IsEncrypt
{
@@ -157,27 +134,6 @@ namespace GeekDesk.ViewModel
{
get
{
- //如果是关联文件夹类型,实时读取
- if (menuType == MenuTypeEnum.RELATION_FOLDER)
- {
- DirectoryInfo dir = new DirectoryInfo(RelationPath);
- if (dir.Exists)
- {
- ObservableCollection relationIconInfo = new ObservableCollection();
- var folders = dir.GetDirectories();
- foreach (var directoryInfo in folders)
- {
- relationIconInfo.Add(CommonCode.GetIconInfoByPath(directoryInfo.FullName));
- }
- var files = dir.EnumerateFiles().Where(f => MainWindow.appData.AppConfig.FilterExt.Contains(f.Extension.Replace(".", "")));
- foreach (var fileInfo in files)
- {
- relationIconInfo.Add(CommonCode.GetIconInfoByPath(fileInfo.FullName));
- }
-
- return relationIconInfo;
- }
- }
return iconList;
}
set