Hi,
I’m migrating a plugin to RH6 and I can’t figure how to adapt my RH5 license system.
In rhino5 I was doing this, which worked nicely:
Dim validator As New Rhino.PlugIns.ValidateProductKeyDelegate(AddressOf ValidateProductKey)
Dim rc As Boolean = GetLicense(Rhino.PlugIns.LicenseBuildType.Release, validator)
But I dont get how to do the exact same thing with Rhino6 (I don’t need CloudZoo). I understood that I had to create a OnLeaseChangedDelegate
but when rhino starts it only display an empty license windows, with no field for serial number.
Here is my code:
' Ask Rhino to get a product license.
Dim validator As New Rhino.PlugIns.ValidateProductKeyDelegate(AddressOf ValidateProductKey)
Dim LeaseChanged As New Rhino.PlugIns.OnLeaseChangedDelegate(AddressOf OnLeaseChanged)
Dim rc As Boolean = GetLicense(Rhino.PlugIns.LicenseBuildType.Release, validator, LeaseChanged)
If Not rc Then
Return Rhino.PlugIns.LoadReturnCode.ErrorNoDialog
End If
Private Sub OnLeaseChanged(ByVal args As LicenseLeaseChangedEventArgs, <Out> ByRef icon As System.Drawing.Icon)
icon = My.Resources.BeamCalc
'If args.Lease Is Nothing Then
'End If
End Sub
And this is what I get when starting rhino (It pops up several times if I try to close it):