Init
This commit is contained in:
28
Shared/Models/RelativePaths.cs
Normal file
28
Shared/Models/RelativePaths.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using View_by_Distance.Shared.Models.Methods;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class RelativePaths : Properties.IRelativePaths, IRelativePaths
|
||||
{
|
||||
|
||||
protected string _Value;
|
||||
public string Value => _Value;
|
||||
|
||||
[JsonConstructor]
|
||||
public RelativePaths(string value) => _Value = value;
|
||||
|
||||
public DirectoryInfo GetDirectoryInfo(string root)
|
||||
{
|
||||
DirectoryInfo result = new(string.Concat(root, Value));
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user