Rewrote references

This commit is contained in:
2014-08-31 14:41:24 +03:00
parent 520eed12a6
commit 10aa72176e
24 changed files with 1182 additions and 475 deletions

View File

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

View File

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