Beispiel #1
0
        internal static void CicleControls(String formName, Control.ControlCollection controls, String culture)
        {
            foreach (Control control in controls)
            {
                try
                {
                    Type controlType = control.GetType();

                    if (controlType == typeof(TextBox) || controlType == typeof(Label) || controlType == typeof(LinkLabel) || controlType == typeof(Button) ||
                        controlType == typeof(CheckBox) || controlType == typeof(RadioButton) || controlType == typeof(RichTextBox) || controlType == typeof(TabControl))
                    {
                        GeneralControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(TabPage))
                    {
                        TabPageControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(FlowLayoutPanel) || controlType == typeof(Panel) || controlType == typeof(SplitContainer) || controlType == typeof(SplitterPanel) || controlType == typeof(ContextMenuStrip))
                    {
                        PanelMenuControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(GroupBox))
                    {
                        GroupBoxControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(MenuStrip))
                    {
                        MenuStripControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(ToolStrip))
                    {
                        ToolStripControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(StatusStrip))
                    {
                        StatusStripControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(ComboBox))
                    {
                        ComboBoxControl.ManageControl(control, formName, culture);
                    }
                    else if (controlType == typeof(TreeView))
                    {
                        TreeViewControl.ManageControl(control, formName, culture);
                    }
                }
                catch (Exception exception)
                {
                    throw new LanguageException(String.Format("{0} - {1}", control.Name, exception.Message));
                }
            }
        }
Beispiel #2
0
        internal static void CicleControls(String formName, Control.ControlCollection controls, bool isFormReloading)
        {
            foreach (Control control in controls)
            {
                if (control.Tag != null && control.Tag.ToString() == ConstantUtil.dontTranslate)
                {
                    continue;
                }

                try
                {
                    Type controlType = control.GetType();

                    if (controlType == typeof(TextBox) || controlType == typeof(Label) || controlType == typeof(LinkLabel) || controlType == typeof(Button) || controlType == typeof(CheckBox) || controlType == typeof(CustomCheckBox) ||
                        controlType == typeof(RadioButton) || controlType == typeof(RichTextBox) || (controlType == typeof(CustomXtraTabControl) && !isFormReloading) || controlType == typeof(TabControl) ||
                        controlType == typeof(XtraTabControl) || controlType == typeof(XmlGridView) || controlType == typeof(DataGridView))
                    {
                        GeneralControl.ManageControl(control, formName, isFormReloading);
                    }
                    else if (controlType == typeof(TabPage))
                    {
                        TabPageControl.ManageControl(control, formName, isFormReloading);
                    }
                    else if (controlType == typeof(XtraTabPage))
                    {
                        XtraTabPageControl.ManageControl(control, formName, isFormReloading);
                    }
                    else if (controlType == typeof(FlowLayoutPanel) || controlType == typeof(Panel) || controlType == typeof(SplitContainer) ||
                             controlType == typeof(SplitterPanel) || controlType == typeof(ContextMenuStrip))
                    {
                        PanelMenuControl.ManageControl(control, formName, isFormReloading);
                    }
                    else if (controlType == typeof(GroupBox))
                    {
                        GroupBoxControl.ManageControl(control, formName, isFormReloading);
                    }
                    else if (controlType == typeof(MenuStrip))
                    {
                        MenuStripControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(ToolStrip))
                    {
                        ToolStripControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(StatusStrip))
                    {
                        StatusStripControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(ComboBox) || (controlType == typeof(ComboBoxEdit)))
                    {
                        ComboBoxControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(CustomComboBox))
                    {
                        CustomComboBoxControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(CustomNumericUpDown))
                    {
                        CustomNumericUpDownControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(TreeView))
                    {
                        TreeViewControl.ManageControl(control, formName);
                    }
                    else if (controlType == typeof(ListView))
                    {
                        ListViewControl.ManageControl(control, formName);
                    }
                }
                catch (Exception exception)
                {
                    throw new LanguageException(String.Format("{0} - {1}", control.Name, exception.Message), exception);
                }
            }
        }