mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-29 07:27:36 +08:00
perfect Tools.OpenSourceLibraryList
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using MessagePack;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Application.Models
|
||||
{
|
||||
[MessagePackObject(keyAsPropertyName: true)]
|
||||
public sealed class OpenSourceLibrary
|
||||
public sealed partial class OpenSourceLibrary
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
@@ -12,17 +14,46 @@ namespace System.Application.Models
|
||||
public string? License { get; set; }
|
||||
|
||||
public string? LicenseText { get; set; }
|
||||
|
||||
const string hr = "------------------------------";
|
||||
|
||||
static StringBuilder ToString(OpenSourceLibrary m, StringBuilder sb)
|
||||
{
|
||||
sb.AppendLine(hr);
|
||||
sb.AppendLine(m.Name);
|
||||
sb.AppendLine(hr);
|
||||
sb.AppendLine(m.Url);
|
||||
sb.AppendLine();
|
||||
sb.AppendLine(m.LicenseText);
|
||||
return sb;
|
||||
}
|
||||
|
||||
public static string ToString(IEnumerable<OpenSourceLibrary> items, StringBuilder? sb = null)
|
||||
{
|
||||
sb ??= new StringBuilder();
|
||||
foreach (var item in items)
|
||||
{
|
||||
ToString(item, sb);
|
||||
sb.AppendLine();
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public override string ToString() => ToString(this, new StringBuilder()).ToString();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
||||
[Obsolete("", true)]
|
||||
[Obsolete("待定", true)]
|
||||
public static partial class ProductInfo
|
||||
{
|
||||
[Obsolete("OpenSourceLibrary", true)]
|
||||
[Obsolete("use System.Application.Models.OpenSourceLibrary", true)]
|
||||
public class Library
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("use System.Application.Models.OpenSourceLibrary.Values/StringValues", true)]
|
||||
public static IReadOnlyCollection<Library> Libraries => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user