protected void CheckForFixedValue(DataGridViewRow theRow)
        {
            DialogResult res = MessageBox.Show("Do you want to specify a fixed value to be applied to all matching records (i.e. rather than using a converter from the system repository)?", cstrCaption, MessageBoxButtons.YesNoCancel);

            if (res == DialogResult.Yes)
            {
                string strSampleValue   = (string)theRow.Cells[cnExampleDataColumn].Value;
                QueryFixedValueForm dlg = new QueryFixedValueForm(strSampleValue);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    string strXmlPath          = (string)theRow.Cells[cnXmlPathsColumn].Value;
                    DirectableEncConverter aEC = GetTempFixedValueConverter(dlg.FixedValue);
                    if (aEC != null)
                    {
                        if (IsConverterDefined(strXmlPath))
                        {
                            m_mapEncConverters.Remove(strXmlPath);
                        }
                        DefineConverter(strXmlPath, aEC);
                        UpdateConverterCellValue(theRow.Cells[cnEncConverterColumn], aEC);
                        UpdateExampleDataColumns(theRow, strSampleValue);
                        m_aECLast = aEC;
                    }
                }
            }
        }
示例#2
0
		protected void CheckForFixedValue(DataGridViewRow theRow)
		{
			DialogResult res = MessageBox.Show("Do you want to specify a fixed value to be applied to all matching records (i.e. rather than using a converter from the system repository)?", cstrCaption, MessageBoxButtons.YesNoCancel);
			if (res == DialogResult.Yes)
			{
				string strSampleValue = (string)theRow.Cells[cnExampleDataColumn].Value;
				QueryFixedValueForm dlg = new QueryFixedValueForm(strSampleValue);
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					string strXmlPath = (string)theRow.Cells[cnXmlPathsColumn].Value;
					DirectableEncConverter aEC = GetTempFixedValueConverter(dlg.FixedValue);
					if (aEC != null)
					{
						if (IsConverterDefined(strXmlPath))
							m_mapEncConverters.Remove(strXmlPath);
						DefineConverter(strXmlPath, aEC);
						UpdateConverterCellValue(theRow.Cells[cnEncConverterColumn], aEC);
						UpdateExampleDataColumns(theRow, strSampleValue);
						m_aECLast = aEC;
					}
				}
			}
		}