Mercurial > repos > IBBoard.Windows.Forms
changeset 8:2cbc6ebae6b7
* Add helper methods to translate all of the controls on a form
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 21 Oct 2009 20:10:24 +0000 |
parents | 02a7c7aaf2c1 |
children | fa1921ee34a5 |
files | Windows/Forms/I18N/ControlTranslator.cs |
diffstat | 1 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Windows/Forms/I18N/ControlTranslator.cs Sat Jun 27 19:03:23 2009 +0000 +++ b/Windows/Forms/I18N/ControlTranslator.cs Wed Oct 21 20:10:24 2009 +0000 @@ -13,6 +13,30 @@ { public class ControlTranslator { + /// <summary> + /// Recursively translates a collection of controls, such as those from a form's <code>Controls</code> collection + /// </summary> + /// <param name="controls"></param> + public static void TranslateControls(Control.ControlCollection controls) + { + foreach (Control ctrl in controls) + { + ControlTranslator.TranslateControl(ctrl); + } + } + + /// <summary> + /// Recursively translates a collection of components, such as those from a form's <code>components.Components</code> collection + /// </summary> + /// <param name="components">The components to recursively translate</param> + public static void TranslateComponents(ComponentCollection components) + { + foreach (Component comp in components) + { + ControlTranslator.TranslateComponent(comp); + } + } + public static void TranslateControl(Control ctrl, params object[] replacements) { TranslateControl(ctrl, true, replacements);