Skip to content

Commit 60d4d8b

Browse files
committed
Established constructor overload that accepts ContentTypeDescriptor
This is just a convenience method for initializing a `ContentTypeDescriptorCollection` with a set of content type descriptors deriving from the root content type descriptor (`Root:Configuration:ContentTypes`).
1 parent 23f4cb1 commit 60d4d8b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

OnTopic/Metadata/ContentTypeDescriptorCollection.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public class ContentTypeDescriptorCollection : TopicCollection<ContentTypeDescri
3636
public ContentTypeDescriptorCollection() : base(null) {
3737
}
3838

39+
/// <summary>
40+
/// Initializes a new instance of the <see cref="ContentTypeDescriptorCollection"/> class based on a root <see cref=
41+
/// "ContentTypeDescriptor"/>.
42+
/// </summary>
43+
/// <param name="rootContentType">The <see cref="ContentTypeDescriptor"/> from which to initialize the collection.</param>
44+
public ContentTypeDescriptorCollection(ContentTypeDescriptor? rootContentType) : base(null) {
45+
Refresh(rootContentType);
46+
}
47+
3948
/*==========================================================================================================================
4049
| REFRESH
4150
\-------------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)