Example #1
0
        public override string ToString()
        {
            HelpTopic titleTopic = database.ResolveContext("h.title");

            if (titleTopic != null &&
                titleTopic.Lines.Count > 0 &&
                titleTopic.Lines[0].Text != null)
            {
                return(titleTopic.Lines[0].Text);
            }

            if (database.Name == null)
            {
                return("(unnamed database)");
            }
            else
            {
                return(database.Name);
            }
        }
Example #2
0
        public static HelpTopic GetDefaultTopicOfDatabase(HelpDatabase database)
        {
            if (database == null)
            {
                return(null);
            }

            HelpTopic topic = database.ResolveContext("h.contents");

            if (topic != null)
            {
                return(topic);
            }

            if (database.Topics.Count > 0)
            {
                return(database.Topics[0]);
            }

            return(null);
        }