✨ feture 增加关联实时文件夹
This commit is contained in:
@@ -222,10 +222,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
|
||||
{
|
||||
string menuId = System.Guid.NewGuid().ToString();
|
||||
new Thread(() =>
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
|
||||
string path = dialog.FileName;
|
||||
|
||||
MenuInfo menuInfo = new MenuInfo
|
||||
@@ -246,35 +243,27 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
|
||||
SetListBoxItemEvent((ListBoxItem)obj);
|
||||
Lbi_Selected(obj, null);
|
||||
|
||||
HandyControl.Controls.Growl.Success("菜单关联成功, 后台加载列表!", "MainWindowGrowl");
|
||||
|
||||
FileWatcher.LinkMenuWatcher(menuInfo);
|
||||
}));
|
||||
}).Start();
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
this.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
MenuInfo info = null;
|
||||
foreach (MenuInfo menuInfo in appData.MenuList)
|
||||
{
|
||||
if (menuInfo.MenuId.Equals(menuId))
|
||||
{
|
||||
info = menuInfo;
|
||||
}
|
||||
}
|
||||
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(info.LinkPath);
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
|
||||
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
|
||||
|
||||
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||
foreach (FileSystemInfo fileInfo in fileInfos)
|
||||
{
|
||||
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
|
||||
info.IconList.Add(iconInfo);
|
||||
iconList.Add(iconInfo);
|
||||
}
|
||||
}));
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
foreach (IconInfo iconInfo in iconList)
|
||||
{
|
||||
menuInfo.IconList.Add(iconInfo);
|
||||
}
|
||||
});
|
||||
}).Start();
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace GeekDesk.MyThread
|
||||
foreach (MenuInfo mi in menuList)
|
||||
{
|
||||
ObservableCollection<IconInfo> iconList = mi.IconList;
|
||||
if (iconList == null) continue;
|
||||
foreach (IconInfo icon in iconList)
|
||||
{
|
||||
if (icon == null) continue;
|
||||
|
||||
Reference in New Issue
Block a user