System.Globalization.FormLanguageSwitchSingleton.ReloadListBoxItems C# (CSharp) Method

ReloadListBoxItems() private method

Reloads items in the ListBox. If items are not sorted, selections are kept.
private ReloadListBoxItems ( System listBox, System resources ) : void
listBox System /// ListBox to localize. ///
resources System /// ResourceManager object. ///
return void
		private void ReloadListBoxItems(System.Windows.Forms.ListBox listBox, System.Resources.ResourceManager resources) {
			if (listBox.Items.Count > 0) {
				int[] selectedItems = new int[listBox.SelectedIndices.Count];
				listBox.SelectedIndices.CopyTo(selectedItems, 0);
				ReloadItems(listBox.Name, listBox.Items, listBox.Items.Count, resources);
				if (!listBox.Sorted) {
					for (int i = 0; i < selectedItems.Length; i++) {
						listBox.SetSelected(selectedItems[i], true);
					}
				}
			}
		}