2020-12-30 05:40:42 +00:00
|
|
|
|
using System;
|
2020-06-06 12:13:22 +00:00
|
|
|
|
using System.Linq;
|
2020-12-30 05:40:42 +00:00
|
|
|
|
using System.Text.Json.Serialization;
|
2020-06-06 12:13:22 +00:00
|
|
|
|
|
2021-01-26 09:48:06 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks
|
2020-06-06 12:13:22 +00:00
|
|
|
|
{
|
2021-01-26 09:31:55 +00:00
|
|
|
|
public class AccessLink
|
2020-06-06 12:13:22 +00:00
|
|
|
|
{
|
|
|
|
|
|
public string Path { get; set; }
|
|
|
|
|
|
|
2021-01-26 09:01:12 +00:00
|
|
|
|
public ResultType Type { get; set; } = ResultType.Folder;
|
|
|
|
|
|
|
2020-12-30 05:40:42 +00:00
|
|
|
|
[JsonIgnore]
|
2021-04-14 12:11:40 +00:00
|
|
|
|
public string Name
|
2020-06-06 12:13:22 +00:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
var path = Path.EndsWith(Constants.DirectorySeperator) ? Path[0..^1] : Path;
|
|
|
|
|
|
|
|
|
|
|
|
if (path.EndsWith(':'))
|
|
|
|
|
|
return path[0..^1] + " Drive";
|
|
|
|
|
|
|
|
|
|
|
|
return path.Split(new[] { System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.None)
|
2021-04-14 12:11:40 +00:00
|
|
|
|
.Last();
|
2020-06-06 12:13:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|