2024-08-20 21:49:46 -07:00
|
|
|
|
namespace SourceGit.Models
|
2024-08-20 21:46:36 -07:00
|
|
|
|
{
|
|
|
|
|
public class Hyperlink
|
|
|
|
|
{
|
|
|
|
|
public int Start { get; set; } = 0;
|
|
|
|
|
public int Length { get; set; } = 0;
|
|
|
|
|
public string Link { get; set; } = "";
|
|
|
|
|
public bool IsCommitSHA { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
public Hyperlink(int start, int length, string link, bool isCommitSHA = false)
|
|
|
|
|
{
|
|
|
|
|
Start = start;
|
|
|
|
|
Length = length;
|
|
|
|
|
Link = link;
|
|
|
|
|
IsCommitSHA = isCommitSHA;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Intersect(int start, int length)
|
|
|
|
|
{
|
|
|
|
|
if (start == Start)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (start < Start)
|
|
|
|
|
return start + length > Start;
|
|
|
|
|
|
|
|
|
|
return start < Start + Length;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|