示例#1
0
        public void Logon(string password, Action <LogonResponse> result, Failed failed)
        {
            // create the request...
            RestRequestArgs args = new RestRequestArgs("logon");

            args["password"] = password;

            // send the request...
            this.SendRequest(args, (Action <XElement>) delegate(XElement element)
            {
                // walk...
                LogonResponse response = LogonResponse.FromXmlElement(element);
                if (response == null)
                {
                    throw new InvalidOperationException("'response' is null.");
                }

                // call...
                result(response);
            }, failed);
        }
        public void Logon(String username, String password, Action <LogonResponse> callback, Failed failed)
        {
            // create the request...
            RestRequestArgs args = new RestRequestArgs("logon");

            // add the username and password...
            args["username"] = username;
            args["password"] = password;

            // send the request...
            SendRequest(args, delegate(XElement element)
            {
                // create a result from that...
                LogonResponse response = LogonResponse.FromXmlElement(element);
                if (response == null)
                {
                    throw new InvalidOperationException("'response' is null.");
                }

                // callback...
                callback(response);
            }, failed);
        }