C# Class System.Globalization.FormLanguageSwitchSingleton

Mostra file Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
m_instance FormLanguageSwitchSingleton

Public Methods

Method Description
ChangeCurrentThreadUICulture ( System cultureInfo ) : void

Changes the current culture used by the Resource Manager to look up culture-specific resources at run time.

ChangeLanguage ( System form ) : void

Changes the language of the Form object provided to the currently selected language.

ChangeLanguage ( System form, System cultureInfo ) : void

Changes the language of the Form object provided and all its MDI children (in the case of MDI UI) to the currently selected language.

Protected Methods

Method Description
FormLanguageSwitchSingleton ( ) : System

Hidden constructor called during static member m_instance initialization.

ReloadControlCommonProperties ( System control, System resources ) : void

Reloads properties common to all controls (except the Text property).

ReloadControlSpecificProperties ( System control, System resources ) : void

Reloads properties specific to some controls.

ReloadListItems ( System control, System resources ) : void

Reloads items in following controls: ComboBox, ListBox, DomainUpDown. Method is made virtual so it can be overriden in derived class to redefine types.

ReloadTextForSelectedControls ( System control, System resources ) : void

Changes Text properties associated with following controls: AxHost, ButtonBase, GroupBox, Label, ScrollableControl, StatusBar, TabControl, ToolBar. Method is made virtual so it can be overriden in derived class to redefine types.

ScanNonControls ( System containerControl, System resources ) : void

Scans controls that are not contained by Controls collection, like MenuItems, StatusBarPanels and ColumnHeaders.

Private Methods

Method Description
ChangeFormLanguage ( System form ) : void

Changes the language of the form.

GetSafeValue ( System resources, string name, object currentValue ) : object

Gets resource value. If resource for new culture does not exists, leaves the current.

GetToolTip ( System control ) : ToolTip

Gets the ToolTip member of the control (Form or UserControl).

RecurControls ( System parent, System resources, System toolTip ) : void

Recurs Controls members of the control to change corresponding texts.

RecurUserControl ( System userControl ) : void

Recurs UserControl to change.

ReloadComboBoxItems ( System comboBox, System resources ) : void

Reloads items in the ComboBox. If items are not sorted, selection is kept.

ReloadFormProperties ( System form, System resources ) : void

Reloads resources specific to the Form type.

ReloadItems ( string controlName, IList list, int itemsNumber, System resources ) : void

Clears all items in the IList and reloads the list with items according to language settings.

ReloadListBoxItems ( System listBox, System resources ) : void

Reloads items in the ListBox. If items are not sorted, selections are kept.

ReloadScrollableControlProperties ( System control, System resources ) : void

Reloads resources specific to the ScrollableControl type.

ReloadTreeViewNodes ( System treeView, System resources ) : void

Reloads content of a TreeView.

ReloadUpDownItems ( System domainUpDown, System resources ) : void

Reloads items in the DomainUpDown control. If items are not sorted, selection is kept.

SetProperty ( System control, string propertyName, System resources ) : void

Reloads resources for a property.

Method Details

ChangeCurrentThreadUICulture() public method

Changes the current culture used by the Resource Manager to look up culture-specific resources at run time.
public ChangeCurrentThreadUICulture ( System cultureInfo ) : void
cultureInfo System
return void

ChangeLanguage() public method

Changes the language of the Form object provided to the currently selected language.
public ChangeLanguage ( System form ) : void
form System /// Form object to apply changes to. ///
return void

ChangeLanguage() public method

Changes the language of the Form object provided and all its MDI children (in the case of MDI UI) to the currently selected language.
public ChangeLanguage ( System form, System cultureInfo ) : void
form System /// Form object to apply changes to. ///
cultureInfo System /// CultureInfo to which language has to be changed. ///
return void

FormLanguageSwitchSingleton() protected method

Hidden constructor called during static member m_instance initialization.
protected FormLanguageSwitchSingleton ( ) : System
return System

ReloadControlCommonProperties() protected method

Reloads properties common to all controls (except the Text property).
protected ReloadControlCommonProperties ( System control, System resources ) : void
control System /// Control object for which resources should be reloaded. ///
resources System /// ResourceManager object. ///
return void

ReloadControlSpecificProperties() protected method

Reloads properties specific to some controls.
protected ReloadControlSpecificProperties ( System control, System resources ) : void
control System /// Control object for which resources should be reloaded. ///
resources System /// ResourceManager object. ///
return void

ReloadListItems() protected method

Reloads items in following controls: ComboBox, ListBox, DomainUpDown. Method is made virtual so it can be overriden in derived class to redefine types.
protected ReloadListItems ( System control, System resources ) : void
control System
resources System /// ResourceManager object. ///
return void

ReloadTextForSelectedControls() protected method

Changes Text properties associated with following controls: AxHost, ButtonBase, GroupBox, Label, ScrollableControl, StatusBar, TabControl, ToolBar. Method is made virtual so it can be overriden in derived class to redefine types.
protected ReloadTextForSelectedControls ( System control, System resources ) : void
control System
resources System /// ResourceManager object. ///
return void

ScanNonControls() protected method

Scans controls that are not contained by Controls collection, like MenuItems, StatusBarPanels and ColumnHeaders.
protected ScanNonControls ( System containerControl, System resources ) : void
containerControl System
resources System /// ResourceManager used to get localized resources. ///
return void

Property Details

m_instance protected_oe static_oe property

Static read-only instance.
protected static FormLanguageSwitchSingleton,System.Globalization m_instance
return FormLanguageSwitchSingleton