예제 #1
0
        private void butNewRow_Click(object sender, EventArgs e)
        {
            frmNewLegendItem item = new frmNewLegendItem
            {
                StyleGallery = ApplicationBase.StyleGallery
            };

            if (item.ShowDialog() == DialogResult.OK)
            {
                object[]       objArray = new object[] { item.YTLegendItem.Symbol, item.YTLegendItem.Description };
                ListViewItemEx ex       = null;
                if (this.renderInfoListView1.SelectedItems.Count > 0)
                {
                    int num = this.renderInfoListView1.SelectedIndices[0];
                    ex = this.renderInfoListView1.Insert(objArray, num);
                }
                else
                {
                    ex = this.renderInfoListView1.Add(objArray);
                }
                ex.Tag = item.YTLegendItem;
                this.btnDeleteAll.Enabled = this.renderInfoListView1.Items.Count > 0;
            }
            if (this.bool_0 && (this.OnValueChange != null))
            {
                this.OnValueChange();
            }
        }
예제 #2
0
 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();
         }
     }
 }