Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for .netstandard 2.0 #8

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DSTV.Net.Test/DSTV.Net.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<Title>Testclass for DSTV.Net</Title>
<TargetFrameworks>net6.0;net7.0;</TargetFrameworks>
EjaYF marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions DSTV.Net/DSTV.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<Description>DSTV.Net is an open-source library tailored for .NET platforms, providing a powerful utility for interacting with DSTV (also known as NC1 or Tekla) files. These files serve as a key industry standard in the steel industry, defining geometry and project information for steel plates.</Description>
<PackageProjectUrl>https://github.com/Baseflow/DSTV.Net</PackageProjectUrl>
<TargetFrameworks>net6.0;net7.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DSTV.Net/Data/DstvElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected static string[] CorrectSplits(string[] separated, bool skipFirst = fal
if (separated is null) throw new ArgumentNullException(nameof(separated));
for (var i = skipFirst ? 1 : 0; i < separated.Length - (skipLast ? 1 : 0); i++)
{
foreach (var match in Regex.Matches(separated[i], "([^.\\d-]+)", RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1)).AsEnumerable())
foreach (Match match in Regex.Matches(separated[i], "([^.\\d-]+)", RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1)))
separated[i] = separated[i].Replace(match.Value, string.Empty, StringComparison.Ordinal);
}

Expand Down
2 changes: 1 addition & 1 deletion DSTV.Net/Implementations/BodyReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private static void AddContoursByType(List<DstvElement> outElemList, List<List<s

if (CheckCodeLine(line))
{
curKey = Enum.Parse<ContourType>(line);
curKey = (ContourType)Enum.Parse(typeof(ContourType), line);
if (!CheckIfMark(line)) Console.WriteLine(line + "Warning: unregistered DStV code-line detected: ");

if (!elemMap.ContainsKey(curKey)) elemMap.Add(curKey, new List<List<string>>());
Expand Down
2 changes: 1 addition & 1 deletion DSTV.Net/Implementations/FineSplitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ internal class FineSplitter : ISplitter
/// <summary>
/// Splitter for full carefully splitting - saving all lexemes
/// </summary>
public string[] Split(string input) => input.Split(" ", StringSplitOptions.RemoveEmptyEntries);
public string[] Split(string input) => input.Split(new [] {" "}, StringSplitOptions.RemoveEmptyEntries);
}
4 changes: 2 additions & 2 deletions DSTV.Net/Implementations/RoughSplitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class RoughSplitter : ISplitter
/// </summary>
public string[] Split(string input)
{
var match = Regex.Match(input, "(?<!\\s|\\D)[a-z]+(?!\\s+|\\D)|\\s+", RegexOptions.None, TimeSpan.FromSeconds(1));
return match.Success ? match.Value.Split(match.Value) : new[] { input };
var match = Regex.Match(input, @"(?<!\s|\D)[a-z]+(?!\s+|\D)|\s+", RegexOptions.None, TimeSpan.FromSeconds(1));
return match.Success ? match.Value.Split(new [] { match.Value }, StringSplitOptions.None) : new[] { input };
}
}
2 changes: 0 additions & 2 deletions DSTVReader.sln.DotSettings

This file was deleted.

1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Version>1.1.1</Version>

<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand Down