예제 #1
0
파일: Topic.cs 프로젝트: apaun/WebApp
        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>());
            }
        }
예제 #2
0
파일: Topic.cs 프로젝트: apaun/WebApp
        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();
            }
        }