Skip to content

Commit

Permalink
chore: net60/ZString related housekeeping (#385)
Browse files Browse the repository at this point in the history
* Directory.Build.props: Remove duplicate entries from Demo and Performance projects
* Enable NRT for Demo and Performance projects
* Remove folder SmartFormat.ZString from former projects SmartFormat.ZString
* Remove obsolete entries from SmartFormat.sln
* Remove reference to former SmartFormat.ZString.dll from SmartFormat.csproj
  • Loading branch information
axunonb authored May 12, 2024
1 parent 6c03255 commit d211c0d
Show file tree
Hide file tree
Showing 303 changed files with 2,839 additions and 69,170 deletions.
4 changes: 1 addition & 3 deletions src/Demo/Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
<TargetFrameworks>net6.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>SmartFormat.Demo.ico</ApplicationIcon>
<LangVersion>8.0</LangVersion>
<Nullable>disable</Nullable>
<NoWarn>1591,1573</NoWarn>
<NoWarn>$(NoWarn);1591,1573</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
23 changes: 11 additions & 12 deletions src/Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using System;
using System.Windows.Forms;

namespace SmartFormat.Demo
namespace SmartFormat.Demo;

internal static class Program
{
static class Program
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main()
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SmartFormatDemo());
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SmartFormatDemo());
}
}
40 changes: 20 additions & 20 deletions src/Demo/Sample Extensions/ArgumentValidator.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
using System;
#nullable enable
using System;
using System.Collections;
#nullable enable
namespace SmartFormat.Demo.Sample_Extensions

namespace Demo.Sample_Extensions;

public class ArgumentValidator
{
public class ArgumentValidator
public static void CheckForNullReference(object? argument, string argumentName)
{
public static void CheckForNullReference(object? argument, string argumentName)
{
if (argument != null) return;
throw new ArgumentNullException(argumentName);
}
if (argument != null) return;
throw new ArgumentNullException(argumentName);
}

public static void CheckForZeroValue(int argument, string argumentName)
{
if (argument != 0) return;
throw new ArgumentOutOfRangeException(argumentName, argument, argumentName + " cannot be zero");
}
public static void CheckForZeroValue(int argument, string argumentName)
{
if (argument != 0) return;
throw new ArgumentOutOfRangeException(argumentName, argument, argumentName + " cannot be zero");
}

public static void CheckForEmpty(IEnumerable argument, string argumentName)
{
var enumerator = argument.GetEnumerator();
if (enumerator.MoveNext()) return;
throw new ArgumentException(argumentName + " cannot be empty", argumentName);
}
public static void CheckForEmpty(IEnumerable argument, string argumentName)
{
var enumerator = argument.GetEnumerator();
if (enumerator.MoveNext()) return;
throw new ArgumentException(argumentName + " cannot be empty", argumentName);
}
}
Loading

0 comments on commit d211c0d

Please sign in to comment.