private void PrepareTopicDictonary() { var parentTypeString = EnumClass.GetTopicParentTypeString(TopicParentType.DataStructures); if (!TopicParentMapping.ContainsKey(parentTypeString)) { TopicParentMapping.Add(parentTypeString, new List <string>()); } TopicParentMapping[parentTypeString].Add(EnumClass.GetTopicTypeString(TopicType.Linked_List)); TopicParentMapping[parentTypeString].Add(EnumClass.GetTopicTypeString(TopicType.Tree)); parentTypeString = EnumClass.GetTopicParentTypeString(TopicParentType.Others); if (!TopicParentMapping.ContainsKey(parentTypeString)) { TopicParentMapping.Add(parentTypeString, new List <string>()); } }
public Topic(TopicParentType topicParent, TopicType topicName, string subTopicName = "") { Topicparent = new TopicParent(topicParent); TopicName = topicName; TopicNameString = EnumClass.GetTopicTypeString(topicName); SubTopicList = new List <SubTopic>(); TopicParentMapping = new Dictionary <string, List <string> >(); PrepareSubTopicDictonary(); if (string.IsNullOrWhiteSpace(subTopicName)) { SubTopicSelected = SubTopicList.FirstOrDefault(); } else { SubTopicSelected = SubTopicList.Where(x => x.SubTopicDescription == subTopicName).FirstOrDefault(); } }