Exemple #1
0
        public Localizer(Control rootControl, GettextResourceManager catalog, ObjectPropertiesStore originalTextStore)
        {
            this.Catalog           = catalog;
            this.OriginalTextStore = originalTextStore;
            this.root = rootControl;

            // Access to form components
            // Try access by container
            IterateControls(root,
                            delegate(Control control) {
                InitFromContainer(control.Container);
            });
            // Access by private member
            for (Control c = root; c != null; c = c.Parent)
            {
                if (c is Form || c is UserControl)
                {
                    FieldInfo fi = c.GetType().GetField("components", BindingFlags.NonPublic | BindingFlags.Instance);
                    if (fi != null)
                    {
                        InitFromContainer((IContainer)fi.GetValue(c));
                    }
                }
            }
        }
Exemple #2
0
        public static void Localize(Control control, GettextResourceManager catalog, ObjectPropertiesStore originalTextStore)
        {
            if (catalog == null)
            {
                return;
            }
            Localizer loc = new Localizer(control, catalog, originalTextStore);

            loc.Localize();
        }
 public LocalizableObjectAdapter(object source, ObjectPropertiesStore store, ToolTipControls toolTips)
 {
     this.Source   = source;
     this.Store    = store;
     this.ToolTips = toolTips;
 }
Exemple #4
0
 public Localizer(Control rootControl, string resourceBaseName, ObjectPropertiesStore originalTextStore)
     : this(rootControl, new GettextResourceManager(resourceBaseName), originalTextStore)
 {
 }
Exemple #5
0
        public static void Revert(Control control, ObjectPropertiesStore originalTextStore)
        {
            Localizer loc = new Localizer(control, new GettextResourceManager(), originalTextStore);

            loc.Revert();
        }
Exemple #6
0
 public Localizer(Control rootControl, string resourceBaseName, ObjectPropertiesStore originalTextStore)
     : this(rootControl, new GettextResourceManager(resourceBaseName, new SingleNameSeparateFolderPathResolver()), originalTextStore)
 {
 }