Esempio n. 1
0
        void menuitem2_Click(object sender, EventArgs e)
        {
            var item = sender as ToolStripMenuItem;

            if (item == null)
            {
                return;
            }


            // step 1、获取值
            UsageTypeEnum utype = UsageTypeEnum.Calibrate;

            if (item.Text.Contains(RIPP.NIR.UsageTypeEnum.Guide.GetDescription()))
            {
                utype = UsageTypeEnum.Guide;
            }
            else if (item.Text.Contains(RIPP.NIR.UsageTypeEnum.Ignore.GetDescription()))
            {
                utype = UsageTypeEnum.Ignore;
            }
            else if (item.Text.Contains(RIPP.NIR.UsageTypeEnum.Validate.GetDescription()))
            {
                utype = UsageTypeEnum.Validate;
            }

            // step 2、获取选中的光谱
            for (int r = 0; r < this.dataGridView1.SelectedRows.Count; r++)
            {
                var row = this.dataGridView1.SelectedRows[r] as mydatarow;
                if (row != null)
                {
                    row.S.Usage        = utype;
                    row.Cells[2].Value = utype.GetDescription();
                }
            }
        }
Esempio n. 2
0
 private void rerender(double[] groupA, double[] groupB, UsageTypeEnum u2)
 {
     foreach (var i in groupA)
     {
         var idx = (int)(i - 1);
         var row = this.dataGridView1.Rows[idx] as mydatarow;
         if (row != null)
         {
             row.S.Usage = UsageTypeEnum.Calibrate;
         }
         row.Cells[2].Value = UsageTypeEnum.Calibrate.GetDescription();
     }
     foreach (var i in groupB)
     {
         var idx = (int)(i - 1);
         var row = this.dataGridView1.Rows[idx] as mydatarow;
         if (row != null)
         {
             row.S.Usage = u2;
         }
         row.Cells[2].Value           = u2.GetDescription();
         row.Cells[2].Style.BackColor = Color.AntiqueWhite;
     }
 }