public override SiteMapNodeCollection GetChildNodes(SiteMapNode node)
        {
            SiteMapNodeCollection nodes = new SiteMapNodeCollection();

            foreach (string topic in DocSiteNavigator.GetSubTopics(node.Key))
            {
                nodes.Add(CreateSiteMapNode(topic));
            }

            return(nodes);
        }
Esempio n. 2
0
        protected void index_SelectedHelpFileChanged(object sender, EventArgs e)
        {
            if (!changingSelection)
            {
                changingSelection = true;

                ContentsSelected = false;
                DocSiteNavigator.NavigateToHelpFile(index.SelectedHelpFile);
                contents.SelectedTopic = DocSiteNavigator.ResolveHelpFileTopic(index.SelectedHelpFile, false);

                changingSelection = false;
            }
        }
Esempio n. 3
0
        protected void contents_SelectedTopicChanged(object sender, EventArgs e)
        {
            if (!changingSelection)
            {
                changingSelection = true;

                ContentsSelected = true;
                DocSiteNavigator.NavigateToTopic(contents.SelectedTopic, false);
                index.SelectedHelpFile = DocSiteNavigator.ResolveTopicHelpFile(contents.SelectedTopic, false);

                changingSelection = false;
            }
        }
 private SiteMapNode CreateSiteMapNode(string topic)
 {
     return(new SiteMapNode(this, topic, DocSiteNavigator.GetTopicUrl(topic, true),
                            GetTopicName(topic), topic));
 }
Esempio n. 5
0
        private void SyncSidebar()
        {
            string topic = null, helpFile = null;

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["filenotfound"] != null)
                {
                    ContentPath = DocSiteNavigator.FileNotFoundPath;
                }
                else
                {
                    topic    = Request.QueryString["topic"];
                    helpFile = Request.QueryString["helpfile"];

                    if (!string.IsNullOrEmpty(topic))
                    {
                        topic = DocSiteNavigator.FormatTopic(topic, false);
                    }
                }
            }
            else
            {
                string topicPath = ContentUrl.Value;

                if (!string.IsNullOrEmpty(topicPath))
                {
                    Uri topicUri;

                    if (Uri.TryCreate(topicPath, UriKind.RelativeOrAbsolute, out topicUri) &&
                        (!topicUri.IsAbsoluteUri || topicUri.Host.Equals(Request.Url.Host, StringComparison.OrdinalIgnoreCase)))
                    {
                        helpFile = topicUri.AbsolutePath;

                        if (helpFile.StartsWith("/") || helpFile.StartsWith(@"\"))
                        {
                            helpFile = helpFile.Substring(1);
                        }
                    }
                }
            }

            if (string.IsNullOrEmpty(helpFile))
            {
                helpFile = DocSiteNavigator.ResolveTopicHelpFile(topic, false) ?? DocSiteNavigator.HelpFileNotFoundPath;
            }

            if (string.IsNullOrEmpty(topic))
            {
                topic = DocSiteNavigator.ResolveHelpFileTopic(helpFile, false);

                if (topic == null)
                {
                    helpFile = DocSiteNavigator.HelpFileNotFoundPath;
                }
            }

            ContentPath = helpFile;

            DocSiteSidebar sidebar = ((DocSite)Page.Master).Sidebar;

            if (!sidebar.TableOfContents.SelectedTopic.Equals(topic, StringComparison.Ordinal))
            {
                sidebar.Initialize(topic, helpFile);
            }
        }