Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- designer.Visible = true;
- var host = (IDesignerHost)designer.Object;
- var provider = TypeDescriptor.GetProvider(host.RootComponent);
- var typeDescriptor = provider.GetExtendedTypeDescriptor(host.RootComponent);
- if (typeDescriptor == null)
- continue;
- var propCollection = typeDescriptor.GetProperties();
- var propDesc = propCollection["Localizable"];
- if (propDesc != null && host.RootComponent != null &&
- (bool?)propDesc.GetValue(host.RootComponent) != true)
- {
- try
- {
- propDesc.SetValue(host.RootComponent, true);
- }
- catch (Exception ex)
- {
- // log the error
- }
- // save changes
- }
Add Comment
Please, Sign In to add comment