-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add IValidationText abstraction (#462)
* Add IValidationText abstraction * Fix stylecop * fix return to pool * cache InitialValidationStates * - * IValidationText as IReadOnlyList * remove ros * simplify ValidationContext * remove usings * add and use ReadOnlyCollectionPooled * Fix ordering to match stylecop rules * Update ReadOnlyCollectionPooled.cs * Update ReactiveUI.Validation.csproj * Update ReactiveUI.Validation.AndroidX.csproj * Update ReactiveUI.Validation.AndroidSupport.csproj * Update ReadOnlyCollectionPooled.cs * Update ArrayPoolExtensions.cs * Update ApiApprovalTests.ValidationProject.net6.0.approved.txt * Update ApiApprovalTests.ValidationProject.net6.0.approved.txt * Update ApiApprovalTests.ValidationProject.net6.0.approved.txt Co-authored-by: Glenn <[email protected]>
- Loading branch information
1 parent
afa35ec
commit e8d1cf8
Showing
24 changed files
with
456 additions
and
215 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/ReactiveUI.Validation.AndroidSupport/ReactiveUI.Validation.AndroidSupport.csproj
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
4 changes: 2 additions & 2 deletions
4
src/ReactiveUI.Validation.AndroidX/ReactiveUI.Validation.AndroidX.csproj
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
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
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
26 changes: 26 additions & 0 deletions
26
src/ReactiveUI.Validation/Collections/ArrayValidationText.cs
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,26 @@ | ||
// Copyright (c) 2022 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace ReactiveUI.Validation.Collections; | ||
|
||
internal sealed class ArrayValidationText : IValidationText | ||
{ | ||
private readonly string[] _texts; | ||
|
||
internal ArrayValidationText(string[] texts) => _texts = texts; | ||
|
||
public int Count => _texts.Length; | ||
|
||
public string this[int index] => _texts[index]; | ||
|
||
public IEnumerator<string> GetEnumerator() => ((IEnumerable<string>)_texts).GetEnumerator(); | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => _texts.GetEnumerator(); | ||
|
||
public string ToSingleLine(string? separator) => string.Join(separator, _texts); | ||
} |
Oops, something went wrong.