/// <summary>
        /// Retrieves one more secondary page
        /// and puts data from it to the corresponding <see cref="PageData"/>.
        /// </summary>
        public void GetMore()
        {
            var downloaded = QueryProcessor.Download(
                m_wiki,
                QueryPageProcessor.ProcessParameters(
                    m_propQueryParametersCollection, m_currentParameters,
                    m_pageProperties, false, m_secondaryQueryContinues.Keys),
                new[] { m_primaryQueryContinue }.Concat(m_secondaryQueryContinues.Values));

            var queryContinues = QueryProcessor.GetQueryContinues(downloaded);

            if (m_generator != null)
            {
                queryContinues.Remove(m_generator);
            }

            var pageElements = downloaded.Element("query").Element("pages").Elements("page");

            foreach (var pageElement in pageElements)
            {
                long pageId = ValueParser.ParseInt64(pageElement.Attribute("pageid").Value);

                PageData pageData;
                if (m_pages.TryGetValue(pageId, out pageData))
                {
                    pageData.AddData(pageElement);
                }
            }

            m_secondaryQueryContinues = queryContinues;
        }
Beispiel #2
0
        public PageData(
            WikiInfo wiki, XElement element, Dictionary <string, QueryTypeProperties> pageProperties,
            PagingManager pagingManager)
        {
            m_wiki           = wiki;
            m_pageProperties = pageProperties;
            m_pagingManager  = pagingManager;

            GetOrCreateDataList("info").Add(m_pageProperties["info"].Parser(element, wiki));

            var pageIdAttribute = element.Attribute("pageid");

            if (pageIdAttribute != null)
            {
                PageId = ValueParser.ParseInt64(pageIdAttribute.Value);

                AddData(element);
            }
        }