예제 #1
0
        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!";
        }
예제 #2
0
        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!";
        }
예제 #3
0
        private void leaseBtn_Click(object sender, EventArgs e)
        {
            try
            {
                LexFloatClient.SetHostProductId("PASTE_YOUR_PRODUCT_ID");
                LexFloatClient.SetHostUrl("http://localhost:8090");
                LexFloatClient.SetFloatingLicenseCallback(LicenceRenewCallback);

                LexFloatClient.RequestFloatingLicense();
                this.statusLabel.Text = "License leased successfully!";
            }
            catch (LexFloatClientException ex)
            {
                this.statusLabel.Text = "Error code: " + ex.Code.ToString() + " Error message: " + ex.Message;
            }
        }
예제 #4
0
 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;
     }
 }
예제 #5
0
        static void Main(string[] args)
        {
            try
            {
                LexFloatClient.SetHostProductId("PASTE_PRODUCT_ID");
                LexFloatClient.SetHostUrl("http://localhost:8090");
                LexFloatClient.SetFloatingLicenseCallback(LicenseRenewCallback);

                LexFloatClient.RequestFloatingLicense();
                Console.WriteLine("Success! License acquired.");
                Console.WriteLine("Press Enter to drop the license ...");
                Console.ReadKey();
                LexFloatClient.DropFloatingLicense();
                Console.WriteLine("Success! License dropped successfully.");
            }
            catch (LexFloatClientException ex)
            {
                Console.WriteLine("Error code: " + ex.Code.ToString() + " Error message: " + ex.Message);
            }
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }