private void leaseBtn_Click(object sender, EventArgs e) { if (LexFloatClient.HasFloatingLicense() == LexFloatClient.StatusCodes.LF_OK) { return; } int status; status = LexFloatClient.SetHostProductId("PASTE_YOUR_PRODUCT_ID"); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting product id: " + status.ToString(); return; } status = LexFloatClient.SetHostUrl("http://localhost:8090"); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting host url: " + status.ToString(); return; } status = LexFloatClient.SetFloatingLicenseCallback(LicenceRenewCallback); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting callback function: " + status.ToString(); return; } status = LexFloatClient.RequestFloatingLicense(); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error requesting license: " + status.ToString(); return; } this.statusLabel.Text = "License leased successfully!"; }
private void dropBtn_Click(object sender, EventArgs e) { if (LexFloatClient.HasFloatingLicense() != LexFloatClient.StatusCodes.LF_OK) { return; } int status; status = LexFloatClient.DropFloatingLicense(); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error dropping license: " + status.ToString(); return; } this.statusLabel.Text = "License dropped successfully!"; }
private void dropBtn_Click(object sender, EventArgs e) { try { if (!LexFloatClient.HasFloatingLicense()) { return; } LexFloatClient.DropFloatingLicense(); this.statusLabel.Text = "License dropped successfully!"; } catch (LexFloatClientException ex) { this.statusLabel.Text = "Error code: " + ex.Code.ToString() + " Error message: " + ex.Message; } }