Esempio n. 1
0
        private void items_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            RadGalleryItem radGalleryItem = (RadGalleryItem)target;

            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
                radGalleryItem.Click      += new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover += new EventHandler(this.item_MouseHover);
                if (this.GetBitState(35184372088832L))
                {
                    radGalleryItem.AddBehavior((PropertyChangeBehavior)this.zoomBehavior);
                }
                radGalleryItem.Owner = this;
                radGalleryItem.StretchHorizontally = false;
                radGalleryItem.StretchVertically   = false;
                break;

            case ItemsChangeOperation.Removed:
                radGalleryItem.Click      -= new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover -= new EventHandler(this.item_MouseHover);
                break;
            }
            this.SetUpDownButtons();
        }
Esempio n. 2
0
        private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            RadGalleryItem item = target as RadGalleryItem;

            if (item != null)
            {
                switch (operation)
                {
                case ItemsChangeOperation.Inserted:
                    item.Click      += new EventHandler(galleryItem_Clicked);
                    item.MouseHover += new EventHandler(item_MouseHover);
                    if (this.GetBitState(ZoomItemsStateKey))
                    {
                        item.AddBehavior(this.zoomBehavior);
                    }
                    item.Owner = this;
                    item.StretchHorizontally = false;
                    item.StretchVertically   = false;

                    break;

                case ItemsChangeOperation.Removed:
                    item.Click      -= new EventHandler(galleryItem_Clicked);
                    item.MouseHover -= new EventHandler(item_MouseHover);
                    break;
                }
            }
            this.SetUpDownButtons();
        }
Esempio n. 3
0
 private void ScrollToSelectedItem()
 {
     if (this.lastClickedItem != null)
     {
         this.inribbonItemsLayoutPanel.ScrollToElement(this.lastClickedItem);
         this.SetUpDownButtons();
         this.lastClickedItem = null;
     }
 }
Esempio n. 4
0
 private void ScrollToSelectedItem()
 {
     if (this.lastClickedItem == null)
     {
         return;
     }
     this.inribbonItemsLayoutPanel.ScrollToElement((RadElement)this.lastClickedItem);
     this.SetUpDownButtons();
     this.lastClickedItem = (RadGalleryItem)null;
 }
Esempio n. 5
0
 private static void RemoveItemsContainedInGroup(ArrayList items, RadItemOwnerCollection groupItems)
 {
     for (int num1 = 0; num1 < groupItems.Count; num1++)
     {
         RadGalleryItem item1 = groupItems[num1] as RadGalleryItem;
         int            num2  = items.IndexOf(item1);
         if (num2 >= 0)
         {
             items.RemoveAt(num2);
             num1--;
         }
     }
 }
Esempio n. 6
0
 private void galleryItem_Clicked(object sender, EventArgs e)
 {
     this.lastClickedItem = sender as RadGalleryItem;
     if (this.lastClickedItem == null)
     {
         return;
     }
     this.SelectedItem = this.lastClickedItem;
     if (this.lastClickedItem.ElementTree != null && this.lastClickedItem.ElementTree.Control is ZoomPopup || !this.downMenu.IsVisible)
     {
         return;
     }
     this.downMenu.CallOnMouseLeave(EventArgs.Empty);
     this.CloseDropDown();
 }
Esempio n. 7
0
 private static void RemoveItemsContainedInGroup(
     ArrayList items,
     RadItemOwnerCollection groupItems)
 {
     for (int index1 = 0; index1 < groupItems.Count; ++index1)
     {
         RadGalleryItem groupItem = groupItems[index1] as RadGalleryItem;
         int            index2    = items.IndexOf((object)groupItem);
         if (index2 >= 0)
         {
             items.RemoveAt(index2);
             --index1;
         }
     }
 }
Esempio n. 8
0
 private void MoveUpAction(object sender, EventArgs e)
 {
     int[] numArray = new int[this.AssignedItemsBox.SelectedItems.Count];
     for (int index1 = 0; index1 < this.AssignedItemsBox.SelectedItems.Count; ++index1)
     {
         RadGalleryItem instance = ((GroupedItemsEditorUI.InstanceItem) this.AssignedItemsBox.SelectedItems[index1]).Instance;
         int            index2   = this.defaultGroup.Items.IndexOf((RadItem)instance);
         numArray[index1] = index2 - 1;
         this.defaultGroup.Items.RemoveAt(index2);
         this.defaultGroup.Items.Insert(index2 - 1, (RadItem)instance);
     }
     this.AssignedItemsBox.BeginUpdate();
     this.PopulateAssignedItems();
     foreach (int index in numArray)
     {
         this.AssignedItemsBox.SetSelected(index, true);
     }
     this.AssignedItemsBox.EndUpdate();
     this.SetButtonsEnabledState();
 }
Esempio n. 9
0
        private void MoveUpAction(object sender, EventArgs e)
        {
            int[] numArray1 = new int[this.AssignedItemsBox.SelectedItems.Count];

            for (int num1 = 0; num1 < this.AssignedItemsBox.SelectedItems.Count; num1++)
            {
                RadGalleryItem item1 = ((InstanceItem)this.AssignedItemsBox.SelectedItems[num1]).Instance;
                int            num2  = this.defaultGroup.Items.IndexOf(item1);
                numArray1[num1] = num2 - 1;
                this.defaultGroup.Items.RemoveAt(num2);
                this.defaultGroup.Items.Insert(num2 - 1, item1);
            }

            this.AssignedItemsBox.BeginUpdate();
            this.PopulateAssignedItems();
            foreach (int num3 in numArray1)
            {
                this.AssignedItemsBox.SetSelected(num3, true);
            }
            this.AssignedItemsBox.EndUpdate();
            this.SetButtonsEnabledState();
        }
 public GalleryItemHoverEventArgs(RadGalleryItem galleryItem)
 {
     this.item = galleryItem;
 }
Esempio n. 11
0
 public InstanceItem(RadGalleryItem instance, RadGalleryElement owner)
 {
     this.instance = instance;
     this.owner    = owner;
 }
Esempio n. 12
0
        public object Clone()
        {
            RadGalleryItem newItem = new RadGalleryItem(this.Text, this.Image);

            return(newItem);
        }