private void PopulateAvailableItems() { ArrayList list1 = new ArrayList(); //load unassingned items foreach (RadGalleryGroupItem item1 in defaultElement.Groups) { list1.Add(item1); } foreach (RadGalleryGroupFilter filter1 in defaultElement.Filters) { FilteredItemsEditorUI.RemoveItemsContainedInFilter(list1, filter1.Items); } for (int i = 0; i < list1.Count; i++) { list1[i] = new InstanceItem((list1[i] as RadGalleryGroupItem), null, defaultElement); } //load assingned to other groups items ArrayList list2 = new ArrayList(); foreach (RadGalleryGroupFilter filter1 in defaultElement.Filters) { if (filter1 != defaultFilter) { foreach (RadGalleryGroupItem item1 in filter1.Items) { list2.Add(new InstanceItem(item1, filter1, defaultElement)); } } } // set the unassigned items box this.AvailableItemsBox.BeginUpdate(); this.AvailableItemsBox.Items.Clear(); this.AvailableItemsBox.Items.AddRange(list1.ToArray()); this.AvailableItemsBox.EndUpdate(); // set the assigned to other groups items box this.AvailableItemsBox2.BeginUpdate(); this.AvailableItemsBox2.Items.Clear(); this.AvailableItemsBox2.Items.AddRange(list2.ToArray()); this.AvailableItemsBox2.EndUpdate(); this.SetButtonsEnabledState(); }
private void PopulateAvailableItems() { ArrayList items = new ArrayList(); foreach (RadGalleryGroupItem group in (RadItemCollection)this.defaultElement.Groups) { items.Add((object)group); } foreach (RadGalleryGroupFilter filter in (RadItemCollection)this.defaultElement.Filters) { FilteredItemsEditorUI.RemoveItemsContainedInFilter(items, filter.Items); } for (int index = 0; index < items.Count; ++index) { items[index] = (object)new FilteredItemsEditorUI.InstanceItem(items[index] as RadGalleryGroupItem, (RadGalleryGroupFilter)null, this.defaultElement); } ArrayList arrayList = new ArrayList(); foreach (RadGalleryGroupFilter filter in (RadItemCollection)this.defaultElement.Filters) { if (filter != this.defaultFilter) { foreach (RadGalleryGroupItem instance in (RadItemCollection)filter.Items) { arrayList.Add((object)new FilteredItemsEditorUI.InstanceItem(instance, filter, this.defaultElement)); } } } this.AvailableItemsBox.BeginUpdate(); this.AvailableItemsBox.Items.Clear(); this.AvailableItemsBox.Items.AddRange(items.ToArray()); this.AvailableItemsBox.EndUpdate(); this.AvailableItemsBox2.BeginUpdate(); this.AvailableItemsBox2.Items.Clear(); this.AvailableItemsBox2.Items.AddRange(arrayList.ToArray()); this.AvailableItemsBox2.EndUpdate(); this.SetButtonsEnabledState(); }