Thanks, that's seems to work fine.
But I'm sure, you had to put "LicenseManager.CurrentContext = currentContext;" in "finally" block, if restoring of the current context is important (and I suppose it is).
Also, there is System.ComponentModel.Design.DesigntimeLicenseContext class in FCL, which, I'm sure, can be used instead of your TestLicenseContext class.
And I hope it's not important to dispose licenses manually, 'cause they seems to be disposable, but you aren't disposing them in your example.