Skip to content

Commit

Permalink
Added support for .netstandard 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tluijken committed Sep 1, 2023
1 parent 41acb38 commit fbdc24a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
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>
</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 };
}
}
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

0 comments on commit fbdc24a

Please sign in to comment.