[LicenseProvider(typeof(RedistributableLicenseProvider))]
public class MyControl : Control {
// Insert code here.
protected override void Dispose(bool disposing) {
/* All components must dispose of the licenses they grant.
* Insert code here to dispose of the license. */
}
}
控件许可的验证代码(RedistributableLicenseProvider)与控件本身的逻辑完全分离,分工协作保护组件的知识产权。