Revert "新增关联文件夹菜单功能"

This reverts commit ce17e7174e.
This commit is contained in:
BookerLiu
2023-03-20 11:29:59 +08:00
parent 5fa5d3436d
commit c1e83e8a39
9 changed files with 2 additions and 154 deletions

View File

@@ -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

View File

@@ -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<IconInfo> iconList = new ObservableCollection<IconInfo>();
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<IconInfo> relationIconInfo = new ObservableCollection<IconInfo>();
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