示例#1
0
        private void cmbx_SelectedValueChanged(object sender, EventArgs e)
        {
            if (((Control)sender).Visible == false || _clickedsubitem == null)
            {
                return;
            }
            if (sender.GetType() == typeof(EXComboBox))
            {
                EXComboBox excmbx = (EXComboBox)sender;
                object     item   = excmbx.SelectedItem;
                //Is this an combobox item with one image?
                if (item.GetType() == typeof(EXComboBox.EXImageItem))
                {
                    EXComboBox.EXImageItem imgitem = (EXComboBox.EXImageItem)item;
                    //Is the first column clicked -- in that case it's a ListViewItem
                    if (_col == 0)
                    {
                        if (_clickeditem.GetType() == typeof(EXImageListViewItem))
                        {
                            ((EXImageListViewItem)_clickeditem).MyImage = imgitem.MyImage;
                        }
                        else if (_clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                        {
                            EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)_clickeditem;
                            imglstvitem.MyImages.Clear();
                            imglstvitem.MyImages.AddRange(new object[] { imgitem.MyImage });
                        }
                        //another column than the first one is clicked, so we have a ListViewSubItem
                    }
                    else
                    {
                        if (_clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                        {
                            EXImageListViewSubItem imgsub = (EXImageListViewSubItem)_clickedsubitem;
                            imgsub.MyImage = imgitem.MyImage;
                        }
                        else if (_clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                        {
                            EXMultipleImagesListViewSubItem imgsub = (EXMultipleImagesListViewSubItem)_clickedsubitem;
                            imgsub.MyImages.Clear();
                            imgsub.MyImages.Add(imgitem.MyImage);
                            imgsub.MyValue = imgitem.MyValue;
                        }
                    }
                    //or is this a combobox item with multiple images?
                }
                else if (item.GetType() == typeof(EXComboBox.EXMultipleImagesItem))
                {
                    EXComboBox.EXMultipleImagesItem imgitem = (EXComboBox.EXMultipleImagesItem)item;
                    if (_col == 0)
                    {
                        if (_clickeditem.GetType() == typeof(EXImageListViewItem))
                        {
                            ((EXImageListViewItem)_clickeditem).MyImage = (Image)imgitem.MyImages[0];
                        }
                        else if (_clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                        {
                            EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)_clickeditem;
                            imglstvitem.MyImages.Clear();
                            imglstvitem.MyImages.AddRange(imgitem.MyImages);
                        }
                    }
                    else
                    {
                        if (_clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                        {
                            EXImageListViewSubItem imgsub = (EXImageListViewSubItem)_clickedsubitem;
                            if (imgitem.MyImages != null)
                            {
                                imgsub.MyImage = (Image)imgitem.MyImages[0];
                            }
                        }
                        else if (_clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                        {
                            EXMultipleImagesListViewSubItem imgsub = (EXMultipleImagesListViewSubItem)_clickedsubitem;
                            imgsub.MyImages.Clear();
                            imgsub.MyImages.AddRange(imgitem.MyImages);
                            imgsub.MyValue = imgitem.MyValue;
                        }
                    }
                }
            }
            ComboBox c = (ComboBox)sender;

            _clickedsubitem.Text = c.Text;
            c.Visible            = false;
            _clickeditem.Tag     = null;
        }
示例#2
0
 // Token: 0x0600002C RID: 44 RVA: 0x00002D0C File Offset: 0x00000F0C
 private void cmbx_SelectedValueChanged(object sender, EventArgs e)
 {
     if (((Control)sender).Visible && this._clickedsubitem != null)
     {
         if (sender.GetType() == typeof(EXComboBox))
         {
             EXComboBox excmbx = (EXComboBox)sender;
             object     item   = excmbx.SelectedItem;
             if (item.GetType() == typeof(EXComboBox.EXImageItem))
             {
                 EXComboBox.EXImageItem imgitem = (EXComboBox.EXImageItem)item;
                 if (this._col == 0)
                 {
                     if (this._clickeditem.GetType() == typeof(EXImageListViewItem))
                     {
                         ((EXImageListViewItem)this._clickeditem).MyImage = imgitem.MyImage;
                     }
                     else if (this._clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                     {
                         EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)this._clickeditem;
                         imglstvitem.MyImages.Clear();
                         imglstvitem.MyImages.AddRange(new object[]
                         {
                             imgitem.MyImage
                         });
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                 {
                     EXImageListViewSubItem imgsub = (EXImageListViewSubItem)this._clickedsubitem;
                     imgsub.MyImage = imgitem.MyImage;
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                 {
                     EXMultipleImagesListViewSubItem imgsub2 = (EXMultipleImagesListViewSubItem)this._clickedsubitem;
                     imgsub2.MyImages.Clear();
                     imgsub2.MyImages.Add(imgitem.MyImage);
                     imgsub2.MyValue = imgitem.MyValue;
                 }
             }
             else if (item.GetType() == typeof(EXComboBox.EXMultipleImagesItem))
             {
                 EXComboBox.EXMultipleImagesItem imgitem2 = (EXComboBox.EXMultipleImagesItem)item;
                 if (this._col == 0)
                 {
                     if (this._clickeditem.GetType() == typeof(EXImageListViewItem))
                     {
                         ((EXImageListViewItem)this._clickeditem).MyImage = (Image)imgitem2.MyImages[0];
                     }
                     else if (this._clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                     {
                         EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)this._clickeditem;
                         imglstvitem.MyImages.Clear();
                         imglstvitem.MyImages.AddRange(imgitem2.MyImages);
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                 {
                     EXImageListViewSubItem imgsub = (EXImageListViewSubItem)this._clickedsubitem;
                     if (imgitem2.MyImages != null)
                     {
                         imgsub.MyImage = (Image)imgitem2.MyImages[0];
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                 {
                     EXMultipleImagesListViewSubItem imgsub2 = (EXMultipleImagesListViewSubItem)this._clickedsubitem;
                     imgsub2.MyImages.Clear();
                     imgsub2.MyImages.AddRange(imgitem2.MyImages);
                     imgsub2.MyValue = imgitem2.MyValue;
                 }
             }
         }
         ComboBox c = (ComboBox)sender;
         this._clickedsubitem.Text = c.Text;
         c.Visible             = false;
         this._clickeditem.Tag = null;
     }
 }