@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user