System.Web.UI.WebControls.ListBox.SelectMultiple C# (CSharp) Method

SelectMultiple() private method

private SelectMultiple ( string values ) : bool
values string
return bool
		bool SelectMultiple (string [] values)
		{
			ArrayList prev_selected = GetSelectedIndicesInternal ();
			ClearSelection ();
			foreach (string val in values) {
				ListItem item = Items.FindByValue (val);
				if (item != null)
					item.Selected = true;
			}

			ArrayList new_selection = GetSelectedIndicesInternal ();
			int i = prev_selected.Count;
			if (new_selection.Count != i)
				return true;

			while (--i >= 0) {
				if ((int) prev_selected [i] != (int) new_selection [i])
					return true;
			}

			return false;
		}