示例#1
0
 private void RenderInfoListView_DoubleClick(object sender, EventArgs e)
 {
     if (base.SelectedItems.Count > 0)
     {
         Rectangle itemRect = base.GetItemRect(base.SelectedIndices[0]);
         int       num      = this.int_0;
         int       left     = itemRect.Left;
         int       num3     = itemRect.Left;
         int       index    = 0;
         while (index < base.Columns.Count)
         {
             left  = num3;
             num3 += base.Columns[index].Width;
             if ((num > left) && (num < num3))
             {
                 break;
             }
             index++;
         }
         if (index != 0)
         {
             if (((base.SelectedItems.Count == 1) && (this.ColumnEditables != null)) &&
                 this.ColumnEditables[index])
             {
                 this.int_2            = index;
                 this.listViewItem_0   = base.SelectedItems[0];
                 this.textBox.Size     = new Size(num3 - left, this.listViewItem_0.Bounds.Height);
                 this.textBox.Location = new System.Drawing.Point(left, this.listViewItem_0.Bounds.Y);
                 this.textBox.Show();
                 this.textBox.Text = this.listViewItem_0.SubItems[this.int_2].Text;
                 this.textBox.SelectAll();
                 this.textBox.Focus();
             }
         }
         else
         {
             try
             {
                 frmSymbolSelector selector = new frmSymbolSelector();
                 selector.SetStyleGallery(ApplicationBase.StyleGallery);
                 ListViewItemEx ex = base.Items[base.SelectedIndices[0]] as ListViewItemEx;
                 selector.SetSymbol(ex.Style);
                 if (selector.ShowDialog() == DialogResult.OK)
                 {
                     ex.Style = selector.GetSymbol();
                     this.method_1();
                     base.Invalidate();
                     if (this.OnValueChanged != null)
                     {
                         this.OnValueChanged(base.SelectedIndices[0], ex.Style);
                     }
                 }
             }
             catch
             {
             }
         }
     }
 }
示例#2
0
        public void Add(IStyleGalleryItem istyleGalleryItem_0)
        {
            ListViewItemEx ex = new ListViewItemEx(new string[] { istyleGalleryItem_0.Name, istyleGalleryItem_0.Category })
            {
                Tag = istyleGalleryItem_0
            };

            base.Items.Add(ex);
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (this.renderInfoListView1.SelectedIndices.Count != 0)
     {
         ListViewItemEx   ex   = this.renderInfoListView1.SelectedItems[0] as ListViewItemEx;
         frmNewLegendItem item = new frmNewLegendItem
         {
             StyleGallery = ApplicationBase.StyleGallery,
             YTLegendItem = ex.Tag as YTLegendItem
         };
         if (((item.ShowDialog() == DialogResult.OK) && this.bool_0) && (this.OnValueChange != null))
         {
             this.OnValueChange();
         }
     }
 }
示例#4
0
        public void Add(ListViewItemEx listViewItemEx_0)
        {
            int size;

            if (base.Items.Count == 0)
            {
                this.imageList_0.ImageSize = new Size(16, 16);
            }
            object tag = listViewItemEx_0.Tag;

            if (tag is IMarkerSymbol)
            {
                size = (int)(tag as IMarkerSymbol).Size;
                if (size > 40)
                {
                    size = 40;
                }
                if (size > this.imageList_0.ImageSize.Height)
                {
                    this.imageList_0.ImageSize = new Size(size, size);
                }
            }
            else if (tag is ILineSymbol)
            {
                size = (int)(tag as ILineSymbol).Width;
                if (size > 40)
                {
                    size = 40;
                }
                if (size > this.imageList_0.ImageSize.Height)
                {
                    this.imageList_0.ImageSize = new Size(size, size);
                }
            }
            base.Items.Add(listViewItemEx_0);
        }
示例#5
0
        public ListViewItemEx Add(object[] object_0)
        {
            int size;

            if (base.Items.Count == 0)
            {
                this.imageList_0.ImageSize = new Size(16, 16);
            }
            if (object_0 == null)
            {
                return(null);
            }
            string[] strArray = new string[base.Columns.Count];
            strArray[0] = "";
            object obj2 = null;

            for (int i = 0; i < object_0.Length; i++)
            {
                if (i == 0)
                {
                    obj2 = object_0[i];
                }
                else if (object_0[i] != null)
                {
                    strArray[i] = object_0[i].ToString();
                }
                else
                {
                    strArray[i] = "";
                }
            }
            if (obj2 is IMarkerSymbol)
            {
                size = (int)(obj2 as IMarkerSymbol).Size;
                if (size > 40)
                {
                    size = 40;
                }
                if (size > this.imageList_0.ImageSize.Height)
                {
                    this.imageList_0.ImageSize = new Size(size, size);
                }
            }
            else if (obj2 is ILineSymbol)
            {
                size = (int)(obj2 as ILineSymbol).Width;
                if (size > 40)
                {
                    size = 40;
                }
                if (size > this.imageList_0.ImageSize.Height)
                {
                    this.imageList_0.ImageSize = new Size(size, size);
                }
            }
            ListViewItemEx ex = new ListViewItemEx(strArray)
            {
                Style = obj2
            };

            base.Items.Add(ex);
            return(ex);
        }