mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Rewrote references
This commit is contained in:
@ -90,7 +90,7 @@ namespace RainmeterStudio.UI.Controller
|
||||
// Set the reference
|
||||
var name = dialog.SelectedName;
|
||||
|
||||
string folder = OwnerWindow.ProjectPanel.ActiveItem.Data.StoragePath;
|
||||
string folder = OwnerWindow.ProjectPanel.ActiveItem.StoragePath;
|
||||
if (!Directory.Exists(folder))
|
||||
folder = Path.GetDirectoryName(folder);
|
||||
|
||||
|
@ -32,12 +32,23 @@ namespace RainmeterStudio.UI.Controller
|
||||
// Resource name
|
||||
string key = "ProjectItem";
|
||||
|
||||
if (Directory.Exists(item.StoragePath))
|
||||
// Is a file?
|
||||
if (File.Exists(item.StoragePath))
|
||||
{
|
||||
if (String.IsNullOrEmpty(Path.GetExtension(item.StoragePath)))
|
||||
key += "Unknown";
|
||||
|
||||
else
|
||||
key += "_" + Path.GetExtension(item.StoragePath).Substring(1);
|
||||
}
|
||||
|
||||
// Not a file, try to figure out if a directory
|
||||
else if (item.Count > 0 || Directory.Exists(item.StoragePath))
|
||||
{
|
||||
key += "Directory";
|
||||
}
|
||||
|
||||
else if (File.Exists(item.StoragePath))
|
||||
key += "_" + Path.GetExtension(item.StoragePath).Substring(1);
|
||||
|
||||
// None
|
||||
else key += "None";
|
||||
|
||||
// Get icon
|
||||
|
Reference in New Issue
Block a user