Example #1
0
        public void Get(Action <IGetGeolocationResult> callback)
        {
            IWebCall <BaseUserRequest, GetGeolocationResponse> webCall = mixWebCallFactory.GeolocationPost(new BaseUserRequest());

            webCall.OnResponse += delegate(object sender, WebCallEventArgs <GetGeolocationResponse> e)
            {
                callback(new GetGeolocationResult(success: true, e.Response.CountryCode));
            };
            webCall.OnError += delegate
            {
                logger.Critical("Failed to get geolocation info");
                callback(new GetGeolocationResult(success: false, null));
            };
            webCall.Execute();
        }