mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-30 10:19:51 +08:00
28 lines
808 B
C#
28 lines
808 B
C#
using System.IO;
|
|
|
|
namespace MicaSetup.Shell.Dialogs;
|
|
|
|
public class ShellFile : ShellObject
|
|
{
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
|
internal ShellFile(string path)
|
|
{
|
|
var absPath = ShellHelper.GetAbsolutePath(path);
|
|
|
|
if (!File.Exists(absPath))
|
|
{
|
|
throw new FileNotFoundException(
|
|
string.Format(System.Globalization.CultureInfo.InvariantCulture,
|
|
LocalizedMessages.FilePathNotExist, path));
|
|
}
|
|
|
|
ParsingName = absPath;
|
|
}
|
|
|
|
internal ShellFile(IShellItem2 shellItem) => nativeShellItem = shellItem;
|
|
|
|
public virtual string Path => ParsingName;
|
|
|
|
public static ShellFile FromFilePath(string path) => new ShellFile(path);
|
|
}
|