private void PopulateAvailableItems() { ArrayList list1 = new ArrayList(); if (this.FilterTypeBox.SelectedIndex == 0) { //load all items foreach (RadGalleryItem item1 in defaultElement.Items) { if (!(bool)item1.GetValue(RadItem.IsAddNewItemProperty)) { list1.Add(item1); } } foreach (RadGalleryGroupItem group1 in defaultElement.Groups) { GroupedItemsEditorUI.RemoveItemsContainedInGroup(list1, group1.Items); } for (int i = 0; i < list1.Count; i++) { list1[i] = new InstanceItem((list1[i] as RadGalleryItem), defaultElement); } } else if (this.FilterTypeBox.SelectedIndex == 1) { foreach (RadGalleryGroupItem group1 in defaultElement.Groups) { if (group1 != defaultGroup) { //load all items foreach (RadGalleryItem item1 in group1.Items) { list1.Add(new InstanceItem(item1, defaultElement)); } } } } // set the items box this.AvailableItemsBox.BeginUpdate(); this.AvailableItemsBox.Items.Clear(); this.AvailableItemsBox.Items.AddRange(list1.ToArray()); this.AvailableItemsBox.EndUpdate(); this.SetButtonsEnabledState(); }
private void PopulateAvailableItems() { ArrayList items = new ArrayList(); if (this.FilterTypeBox.SelectedIndex == 0) { foreach (RadGalleryItem radGalleryItem in (RadItemCollection)this.defaultElement.Items) { if (!(bool)radGalleryItem.GetValue(RadItem.IsAddNewItemProperty)) { items.Add((object)radGalleryItem); } } foreach (RadGalleryGroupItem group in (RadItemCollection)this.defaultElement.Groups) { GroupedItemsEditorUI.RemoveItemsContainedInGroup(items, group.Items); } for (int index = 0; index < items.Count; ++index) { items[index] = (object)new GroupedItemsEditorUI.InstanceItem(items[index] as RadGalleryItem, this.defaultElement); } } else if (this.FilterTypeBox.SelectedIndex == 1) { foreach (RadGalleryGroupItem group in (RadItemCollection)this.defaultElement.Groups) { if (group != this.defaultGroup) { foreach (RadGalleryItem instance in (RadItemCollection)group.Items) { items.Add((object)new GroupedItemsEditorUI.InstanceItem(instance, this.defaultElement)); } } } } this.AvailableItemsBox.BeginUpdate(); this.AvailableItemsBox.Items.Clear(); this.AvailableItemsBox.Items.AddRange(items.ToArray()); this.AvailableItemsBox.EndUpdate(); this.SetButtonsEnabledState(); }