-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathReadOnlyTopicCollection.cs
68 lines (61 loc) · 3.72 KB
/
ReadOnlyTopicCollection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using System.Collections.ObjectModel;
namespace OnTopic.Collections {
/*============================================================================================================================
| CLASS: READ-ONLY TOPIC COLLECTION
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Represents a collection of <see cref="Topic"/> objects.
/// </summary>
public class ReadOnlyTopicCollection : ReadOnlyCollection<Topic> {
/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Establishes a new <see cref="ReadOnlyTopicCollection"/> based on an existing <see cref="TopicCollection"/>.
/// </summary>
/// <param name="innerCollection">The underlying <see cref="KeyedTopicCollection"/>.</param>
[ExcludeFromCodeCoverage]
public ReadOnlyTopicCollection(IList<Topic>? innerCollection = null) : base(innerCollection?? new List<Topic>()) {
}
/*==========================================================================================================================
| FACTORY METHOD: FROM LIST
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Establishes a new <see cref="ReadOnlyTopicCollection"/> based on an existing <see cref="List{Topic}"/>.
/// </summary>
/// <remarks>
/// The <paramref name="innerCollection"/> will be converted to a <see cref="ReadOnlyTopicCollection"/>.
/// </remarks>
/// <param name="innerCollection">The underlying <see cref="List{Topic}"/>.</param>
[ExcludeFromCodeCoverage]
[Obsolete("This is effectively satisfied by the related overload, and has been removed.", true)]
public ReadOnlyTopicCollection FromList(IList<Topic> innerCollection) => throw new NotImplementedException();
/*==========================================================================================================================
| METHOD: GET TOPIC
\-------------------------------------------------------------------------------------------------------------------------*/
/// <inheritdoc cref="ReadOnlyKeyedTopicCollection{T}.GetTopic(String)"/>
[ExcludeFromCodeCoverage]
[Obsolete(
$"The {nameof(GetValue)} method is not implemented on {nameof(ReadOnlyTopicCollection)}. Use " +
$"{nameof(ReadOnlyKeyedTopicCollection)} instead.",
true
)]
public Topic? GetValue(string key) => throw new NotImplementedException();
/*==========================================================================================================================
| INDEXER
\-------------------------------------------------------------------------------------------------------------------------*/
/// <inheritdoc cref="ReadOnlyKeyedTopicCollection{T}"/>
[ExcludeFromCodeCoverage]
[Obsolete(
$"Indexing by key is not implemented on {nameof(ReadOnlyTopicCollection)}. Use {nameof(ReadOnlyKeyedTopicCollection)} " +
$"instead.",
true
)]
public Topic this[string key] => throw new ArgumentOutOfRangeException(nameof(key));
} //Class
} //Namespace