20221028
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
namespace anbs_cp;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
|
||||
namespace anbs_cp;
|
||||
|
||||
/// <summary>
|
||||
/// Конвертер типов на манер Delphi
|
||||
@@ -107,4 +110,28 @@ public static class TypeConverter
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Конвернтация IHtmlContent
|
||||
/// <summary>
|
||||
/// Преобразует тип <see cref="IHtmlContent"/> в строку <see cref="string"/>.
|
||||
/// </summary>
|
||||
/// <param name="content">Значение, которое нужно преобразовать.</param>
|
||||
/// <returns><see cref="string"/></returns>
|
||||
public static string HtmlContentToString (IHtmlContent content)
|
||||
{
|
||||
//Создаём writer
|
||||
using StringWriter writer = new();
|
||||
//Конвертируем IHtmlContent в string
|
||||
content.WriteTo(writer, HtmlEncoder.Default);
|
||||
//Возвращаем результат
|
||||
return writer.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Преобразует строку <see cref="string"/> в тип <see cref="IHtmlContent"/>.
|
||||
/// </summary>
|
||||
/// <param name="content">Значение, которое нужно преобразовать.</param>
|
||||
/// <returns><see cref="IHtmlContent"/></returns>
|
||||
public static IHtmlContent StringToHtmlContent(string content) => new HtmlContentBuilder().AppendHtml(content);
|
||||
#endregion
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.2022.723</Version>
|
||||
<Version>1.2022.1028</Version>
|
||||
<Authors>Alexander Babaev</Authors>
|
||||
<Product>ANB Software Components Pack</Product>
|
||||
<Description>Library of some useful functions in C# language.</Description>
|
||||
@@ -13,10 +13,10 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<PackageProjectUrl>https://github.com/GoodBoyAlex/anbsoftware_componentspack</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/GoodBoyAlex/anbsoftware_componentspack</RepositoryUrl>
|
||||
<AssemblyVersion>1.2022.723</AssemblyVersion>
|
||||
<FileVersion>1.2022.723</FileVersion>
|
||||
<PackageProjectUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</PackageProjectUrl>
|
||||
<RepositoryUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</RepositoryUrl>
|
||||
<AssemblyVersion>1.2022.1028</AssemblyVersion>
|
||||
<FileVersion>1.2022.1028</FileVersion>
|
||||
<PackageId>ANBSoftware.ComponentsPack</PackageId>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<AnalysisLevel>6.0</AnalysisLevel>
|
||||
@@ -33,6 +33,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="17.1.32210.191" />
|
||||
</ItemGroup>
|
||||
|
||||
|
Reference in New Issue
Block a user