public PagingManager( WikiInfo wiki, string generator, IEnumerable <PropQueryParameters> propQueryParametersCollection, IEnumerable <HttpQueryParameterBase> currentParameters, Dictionary <string, QueryTypeProperties> pageProperties, HttpQueryParameter primaryQueryContinue, Dictionary <string, HttpQueryParameter> secondaryQueryContinues) { m_wiki = wiki; m_generator = generator; m_propQueryParametersCollection = propQueryParametersCollection; m_currentParameters = currentParameters; m_pageProperties = pageProperties; m_primaryQueryContinue = primaryQueryContinue; m_secondaryQueryContinues = secondaryQueryContinues; }
/// <summary> /// Downloads the namespaces for a wiki. /// </summary> private static IEnumerable <Namespace> GetNamespaces(WikiInfo wiki) { var queryProcessor = new QueryProcessor <IEnumerable <Namespace> >( wiki, new QueryTypeProperties <IEnumerable <Namespace> >( "siteinfo", "", QueryType.Meta, null, new TupleList <string, string> { { "action", "query" }, { "meta", "siteinfo" }, { "siprop", "namespaces" } }, null, Namespace.Parse)); return(queryProcessor.ExecuteSingle(QueryParameters.Create <IEnumerable <Namespace> >())); }
public PagingManager( WikiInfo wiki, string generator, IEnumerable<PropQueryParameters> propQueryParametersCollection, IEnumerable<Tuple<string, string>> currentParameters, Dictionary<string, QueryTypeProperties> pageProperties, Tuple<string, string> primaryQueryContinue, Dictionary<string, Tuple<string, string>> secondaryQueryContinues) { m_wiki = wiki; m_generator = generator; m_propQueryParametersCollection = propQueryParametersCollection; m_currentParameters = currentParameters; m_pageProperties = pageProperties; m_primaryQueryContinue = primaryQueryContinue; m_secondaryQueryContinues = secondaryQueryContinues; }
public ModulesSource(WikiInfo wiki, string propsDefaultsPath = null) { Dictionary<string, XElement> propsDefaults = null; if (propsDefaultsPath != null) propsDefaults = XDocument.Load(propsDefaultsPath).Root.Elements().ToDictionary(e => (string)e.Attribute("name")); m_processor = new QueryProcessor<ParamInfo>( wiki, new QueryTypeProperties<ParamInfo>( "paraminfo", "", null, null, new TupleList<string, string> { { "action", "paraminfo" } }, null, e => ParamInfo.Parse(e, propsDefaults))); }
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); } }
public Downloader(WikiInfo wiki) { m_wiki = wiki; }
/// <summary> /// Parses a namespace. /// </summary> public static Namespace ParseNamespace(string value, WikiInfo wiki) { return wiki.Namespaces[ParseInt32(value)]; }
public Wiki(string baseUri = null, string apiPath = null) { m_info = new WikiInfo(baseUri, apiPath); Query = new QueryAction(m_info); }
/// <summary> /// Creates a <see cref="NamespaceInfo"/> by downloading the namespace information /// for a wiki. /// </summary> public NamespaceInfo(WikiInfo wiki) : this(() => GetNamespaces(wiki)) { }
public QueryProcessor(WikiInfo wiki, QueryTypeProperties <T> queryTypeProperties) { m_wiki = wiki; m_queryTypeProperties = queryTypeProperties; }
internal QueryAction(WikiInfo wiki) { m_wiki = wiki; }
public QueryPageProcessor(WikiInfo wiki) { m_wiki = wiki; }
/// <summary> /// Parses a namespace. /// </summary> public static Namespace ParseNamespace(string value, WikiInfo wiki) { return(wiki.Namespaces[ParseInt32(value)]); }