Closed db48x closed 4 years ago
You can't use multiline code with a lambda property (the "=>" notation), you should use a standard property for that, like this:
public string ContentPath
{
get
{
var files = Directory.EnumerateFiles(DownloadPath).ToList();
if (files.Count == 1)
{
FileAttributes attr = File.GetAttributes(files[0]);
if (attr.HasFlag(FileAttributes.Directory))
{
return files[0];
}
}
else
{
return DownloadPath;
}
return null;
}
}
Also, this code might not work, as I think EnumerateFiles doesn't return directories, EnumerateDirectories does that. You should set up a development environment so you can properly test things though.
I installed Visual Studio last night, but it fails to open the solution file. Perhaps it's because I installed VS2017? Apparently VS2019 isn't an option because I'm running it inside a virtual machine…
Clearly I need to find some way to detect errors locally.
The solution requires the latest VS2019 indeed. There should be instructions in the description of one of the repos.
Gracefully handles the case where all the mod's files are inside a directory inside the zip file.
I've never written any C# before, and I don't have a compiler or development environment set up for it. @01010100b, could you check this over and see if it actually works?