-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34c0c34
commit 2557b0c
Showing
5 changed files
with
38 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// // Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.CommandLine.Suggestions; | ||
|
||
namespace System.CommandLine | ||
{ | ||
public class SuggestionSourceList : IReadOnlyList<ISuggestionSource> | ||
{ | ||
private readonly List<ISuggestionSource> _sources = new List<ISuggestionSource>(); | ||
|
||
public void Add(ISuggestionSource source) | ||
{ | ||
_sources.Add(source); | ||
} | ||
|
||
public IEnumerator<ISuggestionSource> GetEnumerator() => _sources.GetEnumerator(); | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
|
||
public void Clear() | ||
{ | ||
_sources.Clear(); | ||
} | ||
|
||
public int Count => _sources.Count; | ||
|
||
public ISuggestionSource this[int index] => _sources[index]; | ||
} | ||
} |