views:

22

answers:

0

In the GetLicense method of a LicenseProvider, there is a context that can be examined for a UsageMode. This is either DesignTime or RunTime.

I assumed that this would behave exactly like a control's DesignMode property but it doesn't appear to.

I've implemented my own LicenseProvider and, as a test, I display the UsageMode everytime the GetLicense method is called.

In the constructor of a control, I call LicenseManage.Validate, which in turn calls my GetLicense Method.

When I drop a control onto a from, a message displays "DesignMode". However, when I run the form, the message still displays "DesignMode".

I'm sure this is the correct behaviour, and I'm not understanding what UsageMode is actually is used for!

ETA: If I read LicenseManage.UsageMode in the constructor of my control, this returns "DesignMode" also, even if I'm running the form.

ETA2: LicenseManager.UsageMode reports the correct information if I don't decorate my class with a custom provider. I don't understand this as I thought the context was coming from the control designer (ie designmode), and I haven't overriden UsageMode. I'll have another dig with reflector...