private void SetProperty(System.Windows.Forms.Control control, string propertyName, System.Resources.ResourceManager resources) {
try {
PropertyInfo propertyInfo = control.GetType().GetProperty(propertyName);
if (propertyInfo != null) {
string controlName = control.Name;
if (control is System.Windows.Forms.Form)
controlName = "$this";
object resObject = resources.GetObject(controlName + "." + propertyName, m_cultureInfo);
if (resObject != null)
propertyInfo.SetValue(control, Convert.ChangeType(resObject, propertyInfo.PropertyType), null);
}
}
catch (AmbiguousMatchException e) {
Trace.WriteLine(e.ToString());
}
}