I need to set a value before InitializeComponent() in the constructor of a visual plugin, namely the UICulture for localization of my component (https://msdn.microsoft.com/en-us/library/b28bx3bh(VS.80).aspx). Is there a way to specify a parameter to the constructor of a visual plugin, or some way to specify a parameter value before InitializeComponent() runs? One alternative option I can think of is to use a registry key or preferences file, but this isn’t what I’m looking for.
[Plugin, VisualPlugin]
public partial class MyVisualPlugin : VisualPlugin, MyCustomInterface
{
public MyVisualPlugin()
{
// need to set locale based on a parameter (integer code or string)
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(“de-DE”);
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(“de-DE”);
Application.EnableVisualStyles();
InitializeComponent();
}
//…
}