/// <summary> /// Loads module names from the wiki. /// </summary> private void RetrieveModuleNames() { var module = m_processor .ExecuteSingle(QueryParameters.Create <ParamInfo>().AddSingleValue("modules", "paraminfo")) .Modules.Single(); m_moduleNames = ((EnumParameterType)module.Parameters.Single(p => p.Name == "modules").Type).Values.ToArray(); m_queryModuleNames = ((EnumParameterType)module.Parameters.Single(p => p.Name == "querymodules").Type).Values.ToArray(); }
/// <summary> /// Loads module names from the wiki. /// </summary> private void RetrieveModuleNames() { var modules = m_processor.ExecuteSingle( QueryParameters.Create <ParamInfo>().AddMultipleValues("modules", new[] { "main", "paraminfo" })) .Modules.ToList(); m_moduleNames = GetParameterValues(modules, "main", "action"); m_queryModuleNames = GetParameterValues(modules, "paraminfo", "querymodules"); }
public LoginResult Login(string name, string password, string token = null) { var queryProcessor = new QueryProcessor <LoginResult>( m_info, new QueryTypeProperties <LoginResult>( "login", "lg", null, null, new TupleList <string, string> { { "action", "login" } }, null, LoginResult.Parse)); var parameters = QueryParameters.Create <LoginResult>(); if (name != null) { parameters = parameters.AddSingleValue("name", name); } if (password != null) { parameters = parameters.AddSingleValue("password", password); } if (token != null) { parameters = parameters.AddSingleValue("token", token); } return(queryProcessor.ExecuteSingle(parameters)); }
public LoginResult Login(string name, string password, string token = null) { var queryProcessor = new QueryProcessor<LoginResult>( m_info, new QueryTypeProperties<LoginResult>( "login", "lg", null, null, new TupleList<string, string> { { "action", "login" } }, null, LoginResult.Parse)); var parameters = QueryParameters.Create<LoginResult>(); if (name != null) parameters = parameters.AddSingleValue("name", name); if (password != null) parameters = parameters.AddSingleValue("password", password); if (token != null) parameters = parameters.AddSingleValue("token", token); return queryProcessor.ExecuteSingle(parameters); }