示例#1
0
        /// <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();
        }
示例#2
0
        /// <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");
        }
示例#3
0
        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));
        }
示例#4
0
        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);
        }