Update shared library to reference data library instead of separate nuget package
This commit is contained in:
parent
bd27977b1e
commit
a8d581eab7
@ -4,7 +4,7 @@
|
|||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<PackageId>RaidMax.IW4MAdmin.SharedLibraryCore</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.SharedLibraryCore</PackageId>
|
||||||
<Version>2022.01.08.1</Version>
|
<Version>2022.01.20.1</Version>
|
||||||
<Authors>RaidMax</Authors>
|
<Authors>RaidMax</Authors>
|
||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<Description>Shared Library for IW4MAdmin</Description>
|
<Description>Shared Library for IW4MAdmin</Description>
|
||||||
<PackageVersion>2022.01.08.1</PackageVersion>
|
<PackageVersion>2022.01.08.2</PackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
|
||||||
@ -44,13 +44,25 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10"/>
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10"/>
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.10"/>
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.10"/>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.Data" Version="1.1.0" />
|
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0"/>
|
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0"/>
|
||||||
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0"/>
|
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Data\Data.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
<Exec Command="if not exist "$(ProjectDir)..\BUILD" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD"
)
)
if not exist "$(ProjectDir)..\BUILD\Plugins" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD\Plugins"
)
)"/>
|
<Exec Command="if not exist "$(ProjectDir)..\BUILD" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD"
)
)
if not exist "$(ProjectDir)..\BUILD\Plugins" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD\Plugins"
)
)"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target DependsOnTargets="BuildOnlySettings;ResolveReferences" Name="CopyProjectReferencesToPackage">
|
||||||
|
<ItemGroup>
|
||||||
|
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"/>
|
||||||
|
</ItemGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,28 +1,35 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||||
|
using SharedLibraryCore.Configuration;
|
||||||
|
|
||||||
namespace SharedLibraryCore
|
namespace SharedLibraryCore
|
||||||
{
|
{
|
||||||
[HtmlTargetElement("color-code")]
|
[HtmlTargetElement("color-code")]
|
||||||
public class ColorCode : TagHelper
|
public class ColorCode : TagHelper
|
||||||
{
|
{
|
||||||
|
public ColorCode(ApplicationConfiguration appConfig)
|
||||||
|
{
|
||||||
|
_allow = appConfig?.EnableColorCodes ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
|
||||||
public bool Allow { get; set; } = false;
|
private readonly bool _allow;
|
||||||
|
|
||||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||||
{
|
{
|
||||||
output.TagName = "ColorCode";
|
output.TagName = "ColorCode";
|
||||||
output.TagMode = TagMode.StartTagAndEndTag;
|
output.TagMode = TagMode.StartTagAndEndTag;
|
||||||
|
|
||||||
if (Allow)
|
if (_allow)
|
||||||
{
|
{
|
||||||
var matches = Regex.Matches(Value, @"\^([0-9]|\:)([^\^]*)");
|
var matches = Regex.Matches(Value, @"\^([0-9]|\:)([^\^]*)");
|
||||||
foreach (Match match in matches)
|
foreach (Match match in matches)
|
||||||
{
|
{
|
||||||
char colorCode = match.Groups[1].ToString().Last();
|
var colorCode = match.Groups[1].ToString().Last();
|
||||||
output.PreContent.AppendHtml($"<span class='text-color-code-{(colorCode >= 48 && colorCode <= 57 ? colorCode.ToString() : ((int)colorCode).ToString())}'>");
|
output.PreContent.AppendHtml(
|
||||||
|
$"<span class='text-color-code-{(colorCode >= 48 && colorCode <= 57 ? colorCode.ToString() : ((int) colorCode).ToString())}'>");
|
||||||
output.PreContent.Append(match.Groups[2].ToString());
|
output.PreContent.Append(match.Groups[2].ToString());
|
||||||
output.PreContent.AppendHtml("</span>");
|
output.PreContent.AppendHtml("</span>");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user