Ejemplo n.º 1
0
        public async Task <bool> CheckLicense()
        {
            CleanUpOldFiles();

            LocalVersionRequestModel newLocalVersionRequest = new LocalVersionRequestModel
            {
                test            = GetRandomNumber(100000, 999999),
                product_name    = ProductName,
                product_version = ProductVersion,
                username        = this.username,
                password        = this.password
            };


            HandleLicense handleLicense = new HandleLicense(newLocalVersionRequest);
            IRequest      licenseRequest;

            if (voted)
            {
                newLocalVersionRequest.voted          = this.voted;
                newLocalVersionRequest.willpay        = this.willpay;
                newLocalVersionRequest.suggestedprice = this.suggestedprice;
                newLocalVersionRequest.email          = this.email;

                licenseRequest = new Request(_uri, newLocalVersionRequest.GetUrlEncodedContentVote(), handleLicense);
            }
            else
            {
                licenseRequest = new Request(_uri, newLocalVersionRequest.GetUrlEncodedContent(), handleLicense);
            }


            var isLicensed = await DoRequests(licenseRequest);

            this.RemoteVersionResponse = handleLicense.RemoteVersionResponseModel;

            UpdateAvaliable = RemoteVersionResponse.update_needed;

            return(isLicensed);
        }
 public HandleLicense(LocalVersionRequestModel localVersionRequestModel)
 {
     this.LocalVersionRequestModel   = localVersionRequestModel;
     this.RemoteVersionResponseModel = new RemoteVersionResponseModel();
 }