diff --git a/csharp/Platform.Setters/Platform.Setters.csproj b/csharp/Platform.Setters/Platform.Setters.csproj index cca1994..1d1f928 100644 --- a/csharp/Platform.Setters/Platform.Setters.csproj +++ b/csharp/Platform.Setters/Platform.Setters.csproj @@ -4,7 +4,7 @@ LinksPlatform's Platform.Setters Class Library Konstantin Diachenko Platform.Setters - 0.2.0 + 0.3.0 Konstantin Diachenko net472;netstandard2.0;netstandard2.1;net5 Platform.Setters @@ -24,7 +24,7 @@ true snupkg latest - Added support for .NET 5. + Setter extensions for setting the first, second, therd element from the first or second list arguments are added. @@ -36,6 +36,7 @@ + diff --git a/csharp/Platform.Setters/SetterExtensions.cs b/csharp/Platform.Setters/SetterExtensions.cs new file mode 100644 index 0000000..c9af60f --- /dev/null +++ b/csharp/Platform.Setters/SetterExtensions.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; + +namespace Platform.Setters +{ + public static class SetterExtensions + { + public static TDecision SetFirstFromFirstListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list1[0]); + return setter.TrueValue; + } + + public static TDecision SetSecondFromFirstListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list1[1]); + return setter.TrueValue; + } + + public static TDecision SetThirdFromFirstListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list1[2]); + return setter.TrueValue; + } + + public static TDecision SetFirstFromSecondListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list2[0]); + return setter.TrueValue; + } + + public static TDecision SetSecondFromSecondListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list2[1]); + return setter.TrueValue; + } + + public static TDecision SetThirdFromSecondListAndReturnTrue(this Setter setter, IList list1, IList list2) + { + setter.Set(list2[2]); + return setter.TrueValue; + } + } +} +