bookmark-manager-r4/Models/BookmarkItemViewModel.cs

64 lines
1.7 KiB
C#
Raw Normal View History

2021-09-07 11:32:24 +00:00
using System;
using System.Text;
namespace bzit.bomg.Models
{
public class BookmarkItemViewModel
{
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 FaviconAddress { 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-09 21:39:23 +00:00
//public BookmarkItemModel ToModel()
//{
// return new BookmarkItemModel()
// {
// SiteName = this.SiteName,
// SiteAddress = this.SiteAddress,
// SiteDescription = this.SiteDescription,
// FaviconAddress = this.FaviconAddress,
// TreeviewPath = this.TreeviewPath
// };
//}
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-07 11:32:24 +00:00
}
}