public Topic AddSubTopic(string topic) { string topicName = topic.ToLower(); Topic subTopic = GetSubTopic(topicName); if(subTopic == null) { subTopic = new Topic(topicName, this); this.SubTopics.Add(topicName, subTopic); } return subTopic; }
public Topic(string topicName, Topic parent) { this.TopicName = topicName.ToLower(); this.parent = parent; if(parent == null) { this.fullName = "/"; } else { this.fullName = parent.fullName + topicName + "/"; } }