コード例 #1
0
        private TopicTreeNode NewTopicNode(DocumentationTopic topic)
        {
            TopicTreeNode topicNode = new TopicTreeNode(topic, topicContextMenuStrip);

            UpdateTopics(topic.Topics, topicNode);

            return(topicNode);
        }
コード例 #2
0
        private string MultiLevelTopic(DocumentationTopic topic)
        {
            JsonObject js = new JsonObject();

            js.Add(Surround("type"), Surround("category"));
            js.Add(Surround("label"), Surround(topic.Title));
            js.Add(Surround("items"), SidebarJsonTopics(topic, topic.Topics));
            return(js.ToString());
        }
コード例 #3
0
        private string SidebarJsonTopics(DocumentationTopic topic, List <DocumentationTopic> topics)
        {
            var extraTopics = new List <DocumentationTopic>();

            extraTopics.Add(new DocumentationTopic()
            {
                Title = topic.Title, AlternativeTitle = "Overview"
            });
            extraTopics.AddRange(topics);

            return(SidebarJsonTopics(extraTopics));
        }
コード例 #4
0
        internal DocumentationTopic RetrieveTopic()
        {
            DocumentationTopic t = new DocumentationTopic()
            {
                Title = Text
            };

            foreach (TopicTreeNode topicNode in Nodes)
            {
                DocumentationTopic topic = topicNode.RetrieveTopic();
                t.Topics.Add(topic);
            }
            return(t);
        }
コード例 #5
0
        internal DocumentationSidebar RetrieveSidebar()
        {
            DocumentationSidebar s = new DocumentationSidebar()
            {
                Title = Text
            };

            foreach (TopicTreeNode topicNode in Nodes)
            {
                DocumentationTopic topic = topicNode.RetrieveTopic();
                s.Topics.Add(topic);
            }

            return(s);
        }
コード例 #6
0
 private string TopicSlug(DocumentationTopic topic)
 {
     return(topic.Title.Trim().Replace(' ', '-').ToLower());
 }
コード例 #7
0
 public TopicTreeNode(DocumentationTopic topic) : base()
 {
     Text = (!string.IsNullOrWhiteSpace(topic.Title) ? topic.Title : "Untitled");
     Tag  = topic;
 }
コード例 #8
0
 public TopicTreeNode(DocumentationTopic topic, ContextMenuStrip topicContextMenuStrip) : this(topic)
 {
     ContextMenuStrip = topicContextMenuStrip;
 }