internal static void UpdateConverterCellValue(DataGridViewCell theCell, DirectableEncConverter aEC) { if (aEC == null) { theCell.Value = cstrClickMsg; theCell.ToolTipText = null; } else { string strName = aEC.Name; if (strName.Length > cnMaxConverterName) strName = strName.Substring(0, cnMaxConverterName); theCell.Value = strName; theCell.ToolTipText = aEC.ToString(); } }
private void setDefaultConverterToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; EncConverters aECs = GetEncConverters; if (aECs != null) { IEncConverter aIEC = aECs.AutoSelectWithTitle(ConvType.Unknown, "Select Default Converter"); if (aIEC != null) { DirectableEncConverter aEC = new DirectableEncConverter(aIEC); foreach (DataGridViewRow aRow in dataGridView.Rows) { string strFontStyle = (string)aRow.Cells[cnFontStyleColumn].Value; if (!IsConverterDefined(strFontStyle)) { DefineConverter(strFontStyle, aEC); // add it aRow.Cells[cnEncConverterColumn].Value = aEC.Name; aRow.Cells[cnEncConverterColumn].ToolTipText = aEC.ToString(); string strInput = (string)aRow.Cells[cnExampleDataColumn].Value; aRow.Cells[cnExampleOutputColumn].Value = CallSafeConvert(aEC, strInput); } } // clear the last one selected so that a right-click can be used to cancel the selection m_aECLast = null; } } Cursor = Cursors.Default; }
protected void UpdateConverterCellValue(DataGridViewCell theCell, DirectableEncConverter aEC) { if (aEC == null) { theCell.Value = (selectProjectToolStripMenuItem.Checked) ? cstrCscClickMsg : cstrClickMsg; theCell.ToolTipText = null; } else { string strName = aEC.Name; if (strName.Length > cnMaxConverterName) strName = strName.Substring(0, cnMaxConverterName); theCell.Value = strName; theCell.ToolTipText = aEC.ToString(); } }
protected void UpdateConverterCellValue(DataGridViewCell theCell, DirectableEncConverter aEC) { if (aEC == null) { theCell.Value = (m_mapEncConverters.Count > 0) ? cstrDots : cstrClickMsg; theCell.ToolTipText = null; } else { string strName = aEC.Name; if (strName.Length > cnMaxConverterName) strName = strName.Substring(0, cnMaxConverterName); theCell.Value = strName; theCell.ToolTipText = aEC.ToString(); } }
private void setDefaultConverterToolStripMenuItem_Click(object sender, EventArgs e) { m_aEcDefault = null; EncConverters aECs = GetEncConverters; if (aECs != null) { IEncConverter aIEC = aECs.AutoSelectWithTitle(ConvType.Unknown, "Choose Default Converter"); if (aIEC != null) { m_aEcDefault = new DirectableEncConverter(aIEC); foreach (DataGridViewRow aRow in dataGridViewConverterMapping.Rows) { string strXmlPath = (string)aRow.Cells[cnXmlPathsColumn].Value; if (!IsConverterDefined(strXmlPath)) { DataGridViewCell cellConverter = aRow.Cells[cnEncConverterColumn]; cellConverter.Value = m_aEcDefault.Name; cellConverter.ToolTipText = m_aEcDefault.ToString(); string strInput = (string)aRow.Cells[cnExampleDataColumn].Value; aRow.Cells[cnExampleOutputColumn].Value = CallSafeConvert(m_aEcDefault, strInput); DefineConverter(strXmlPath, m_aEcDefault); } } m_aECLast = null; } } }
private void setDefaultConverterToolStripMenuItem_Click(object sender, EventArgs e) { EncConverters aECs = OfficeApp.GetEncConverters; if (aECs != null) { IEncConverter aIEC = aECs.AutoSelectWithTitle(ConvType.Unknown, "Select Default Converter"); if (aIEC != null) { DirectableEncConverter aEC = new DirectableEncConverter(aIEC.Name, aIEC.DirectionForward, aIEC.NormalizeOutput); foreach (DataGridViewRow aRow in dataGridViewFontsConverters.Rows) { string strFontName = (string)aRow.Cells[nColumnFontNames].Value; if (!m_mapEncConverters.ContainsKey(strFontName)) { m_mapEncConverters.Add(strFontName, aEC); // add it DataGridViewCell cellConverter = aRow.Cells[nColumnConverterNames]; cellConverter.Value = aEC.Name; cellConverter.ToolTipText = aEC.ToString(); } } // clear the last one selected so that a right-click can be used to cancel the selection m_aECLast = null; } } }