Guest User

Untitled

a guest
May 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. designer.Visible = true;
  2. var host = (IDesignerHost)designer.Object;
  3. var provider = TypeDescriptor.GetProvider(host.RootComponent);
  4. var typeDescriptor = provider.GetExtendedTypeDescriptor(host.RootComponent);
  5. if (typeDescriptor == null)
  6. continue;
  7.  
  8. var propCollection = typeDescriptor.GetProperties();
  9. var propDesc = propCollection["Localizable"];
  10. if (propDesc != null && host.RootComponent != null &&
  11. (bool?)propDesc.GetValue(host.RootComponent) != true)
  12. {
  13. try
  14. {
  15. propDesc.SetValue(host.RootComponent, true);
  16. }
  17. catch (Exception ex)
  18. {
  19. // log the error
  20. }
  21.  
  22. // save changes
  23. }
Add Comment
Please, Sign In to add comment