Пример #1
0
        private void gv2_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string    key              = (string)gv2.Rows[e.RowIndex].Cells[0].Value;
            string    valueOriginal    = (string)gv2.Rows[e.RowIndex].Cells[1].Value;
            string    valueTranslated  = (string)gv2.Rows[e.RowIndex].Cells[2].Value;
            string    prefixOriginal   = (string)gv2.Rows[e.RowIndex].Cells[3].Value;
            string    prefixTranslated = (string)gv2.Rows[e.RowIndex].Cells[4].Value;
            frmEditMP dlg              = new frmEditMP();

            if (dlg.ShowDialog(key, valueTranslated, valueOriginal, prefixTranslated, prefixOriginal) == DialogResult.OK)
            {
                string trans  = dlg.GetTranslation();
                string prefix = dlg.GetPrefixTranslation();

                gv2.Rows[e.RowIndex].Cells[2].Value           = trans;
                gv2.Rows[e.RowIndex].Cells[4].Value           = prefix;
                gv2.Rows[e.RowIndex].Cells[0].Style.ForeColor = String.IsNullOrEmpty(trans)
                                                          ? System.Drawing.Color.Red
                                                          : System.Drawing.Color.Black;
                gv2.Rows[e.RowIndex].Cells[1].Style.ForeColor = String.IsNullOrEmpty(trans)
                                                          ? System.Drawing.Color.Red
                                                          : System.Drawing.Color.Black;
                ToolStripText(GetUntranslatedCountMediaPortal());
            }
        }
Пример #2
0
        private void gv2_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string key = (string)gv2.Rows[e.RowIndex].Cells[0].Value;
              string valueOriginal = (string)gv2.Rows[e.RowIndex].Cells[1].Value;
              string valueTranslated = (string)gv2.Rows[e.RowIndex].Cells[2].Value;
              string prefixOriginal = (string)gv2.Rows[e.RowIndex].Cells[3].Value;
              string prefixTranslated = (string)gv2.Rows[e.RowIndex].Cells[4].Value;
              frmEditMP dlg = new frmEditMP();
              if (dlg.ShowDialog(key, valueTranslated, valueOriginal, prefixTranslated, prefixOriginal) == DialogResult.OK)
              {
            string trans = dlg.GetTranslation();
            string prefix = dlg.GetPrefixTranslation();

            gv2.Rows[e.RowIndex].Cells[2].Value = trans;
            gv2.Rows[e.RowIndex].Cells[4].Value = prefix;
            gv2.Rows[e.RowIndex].Cells[0].Style.ForeColor = String.IsNullOrEmpty(trans)
                                                          ? System.Drawing.Color.Red
                                                          : System.Drawing.Color.Black;
            gv2.Rows[e.RowIndex].Cells[1].Style.ForeColor = String.IsNullOrEmpty(trans)
                                                          ? System.Drawing.Color.Red
                                                          : System.Drawing.Color.Black;
            ToolStripText(GetUntranslatedCountMediaPortal());
              }
        }