修改获取磁盘图标 及 快捷名称获取
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -212,8 +212,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
foreach (object obj in dropObject)
|
||||
{
|
||||
string path = (string)obj;
|
||||
string tempPath = path;
|
||||
|
||||
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Png);
|
||||
//string base64 = ImageUtil.FileImageToBase64(path, System.Drawing.Imaging.ImageFormat.Png);
|
||||
string ext = "";
|
||||
if (!ImageUtil.IsSystemItem(path))
|
||||
{
|
||||
@@ -236,7 +237,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
BitmapImage = bi
|
||||
};
|
||||
iconInfo.DefaultImage = iconInfo.ImageByteArr;
|
||||
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(path);
|
||||
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(tempPath);
|
||||
if (StringUtil.IsEmpty(iconInfo.Name))
|
||||
{
|
||||
iconInfo.Name = path;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
@@ -96,8 +96,17 @@ namespace GeekDesk.Util
|
||||
return FileIcon.GetBitmapImage(filePath);
|
||||
}
|
||||
} else if(Directory.Exists(filePath)) {
|
||||
//文件夹
|
||||
return ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_DIR_IMAGE_BASE64);
|
||||
|
||||
if ((filePath.IndexOf("\\") == filePath.LastIndexOf("\\")) && filePath.IndexOf("\\") == filePath.Length - 1)
|
||||
{
|
||||
//磁盘
|
||||
return ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_DISK_IMAGE_BASE64);
|
||||
} else
|
||||
{
|
||||
//文件夹
|
||||
return ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_DIR_IMAGE_BASE64);
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user