mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-30 10:19:51 +08:00
39 lines
923 B
C#
39 lines
923 B
C#
using System.IO;
|
|
|
|
namespace MicaSetup.Shell.Dialogs;
|
|
|
|
public class ShellFileSystemFolder : ShellFolder
|
|
{
|
|
internal ShellFileSystemFolder()
|
|
{
|
|
}
|
|
|
|
internal ShellFileSystemFolder(IShellItem2 shellItem) => nativeShellItem = shellItem;
|
|
|
|
public virtual string Path => ParsingName;
|
|
|
|
public static ShellFileSystemFolder FromFolderPath(string path)
|
|
{
|
|
var absPath = ShellHelper.GetAbsolutePath(path);
|
|
|
|
if (!Directory.Exists(absPath))
|
|
{
|
|
throw new DirectoryNotFoundException(
|
|
string.Format(System.Globalization.CultureInfo.InvariantCulture,
|
|
LocalizedMessages.FilePathNotExist, path));
|
|
}
|
|
|
|
var folder = new ShellFileSystemFolder();
|
|
try
|
|
{
|
|
folder.ParsingName = absPath;
|
|
return folder;
|
|
}
|
|
catch
|
|
{
|
|
folder.Dispose();
|
|
throw;
|
|
}
|
|
}
|
|
}
|