bookmark-manager-r4/Models/BookmarkItem.cs

54 lines
1.3 KiB
C#
Raw Normal View History

2021-09-30 21:26:17 +00:00
using BookmarkManager;
using System;
2021-09-07 11:32:24 +00:00
using System.Text;
namespace bzit.bomg.Models
{
2021-09-17 15:37:01 +00:00
public class BookmarkItem
2021-09-07 11:32:24 +00:00
{
public string SiteName { get; set; }
2021-09-12 13:40:44 +00:00
2021-09-07 11:32:24 +00:00
public string SiteAddress { get; set; }
2021-09-12 13:40:44 +00:00
2021-09-07 11:32:24 +00:00
public string SiteDescription { get; set; }
2021-09-12 13:40:44 +00:00
2021-09-07 11:32:24 +00:00
public string TreeviewPath { get; set; }
2021-09-14 19:36:04 +00:00
public string Notes { get; set; }
2021-09-07 11:32:24 +00:00
public new string ToString()
{
StringBuilder sb = new StringBuilder();
2021-09-14 19:36:04 +00:00
if (!string.IsNullOrWhiteSpace(this.SiteName))
{
sb.AppendLine("Name");
sb.AppendLine(this.SiteName + Environment.NewLine);
}
if (!string.IsNullOrWhiteSpace(this.SiteAddress))
{
sb.AppendLine("Address");
sb.AppendLine(this.SiteAddress + Environment.NewLine);
}
2021-09-07 11:32:24 +00:00
2021-09-14 19:36:04 +00:00
if (!string.IsNullOrWhiteSpace(this.SiteDescription))
{
sb.AppendLine("Description");
sb.AppendLine(this.SiteDescription + Environment.NewLine);
}
if (!string.IsNullOrWhiteSpace(this.Notes))
{
sb.AppendLine("Notes");
sb.AppendLine(this.Notes + Environment.NewLine);
}
2021-09-07 11:32:24 +00:00
return sb.ToString();
}
2021-09-14 19:36:04 +00:00
2021-09-30 21:26:17 +00:00
public string ToHash() => Crypto.GetSHA256Hash(this.SiteAddress);
2021-09-07 11:32:24 +00:00
}
}