-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from linksplatform/feature/add_setter_extensions
Add Setter extensions
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Platform.Setters | ||
{ | ||
public static class SetterExtensions | ||
{ | ||
public static TDecision SetFirstFromFirstListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list1[0]); | ||
return setter.TrueValue; | ||
} | ||
|
||
public static TDecision SetSecondFromFirstListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list1[1]); | ||
return setter.TrueValue; | ||
} | ||
|
||
public static TDecision SetThirdFromFirstListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list1[2]); | ||
return setter.TrueValue; | ||
} | ||
|
||
public static TDecision SetFirstFromSecondListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list2[0]); | ||
return setter.TrueValue; | ||
} | ||
|
||
public static TDecision SetSecondFromSecondListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list2[1]); | ||
return setter.TrueValue; | ||
} | ||
|
||
public static TDecision SetThirdFromSecondListAndReturnTrue<TResult, TDecision>(this Setter<TResult, TDecision> setter, IList<TResult> list1, IList<TResult> list2) | ||
{ | ||
setter.Set(list2[2]); | ||
return setter.TrueValue; | ||
} | ||
} | ||
} | ||
|