mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
29 lines
739 B
C#
29 lines
739 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks
|
|
{
|
|
public class AccessLink
|
|
{
|
|
public string Path { get; set; }
|
|
|
|
public ResultType Type { get; set; } = ResultType.Folder;
|
|
|
|
[JsonIgnore]
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
var path = Path.EndsWith(Constants.DirectorySeparator) ? Path[0..^1] : Path;
|
|
|
|
if (path.EndsWith(':'))
|
|
return path[0..^1] + " Drive";
|
|
|
|
return path.Split(new[] { System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.None)
|
|
.Last();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|