TopicSource.AddSubtopic Method

Namespace
Kampute.DocToolkit.Topics.Abstracts
Assembly
  • Kampute.DocToolkit.dll

Definition

Adds a subtopic to the current topic.
public void AddSubtopic(IMutableTopic subtopic)

Parameters

subtopic IMutableTopic
The subtopic to add.

Exceptions

ArgumentNullException
Thrown when subtopic is null.
ArgumentException
Thrown when a subtopic with the same identifier already exists in the current topic.
InvalidOperationException
Thrown when adding the subtopic would create a circular reference.

Remarks

This methods adds a subtopic to the current topic if it is not already a child of the topic, its identifier is not already used by another subtopic, and it does not create a circular reference in the topic hierarchy.

If the subtopic is already a child of another topic, it will be moved from that topic to the current topic.