Пример #1
0
        public void EditSpellingFixes()
        {
            if (m_strConverterSpec != null)
            {
                // Open the CC table that has the mappings and put them in a DataTable.
                if (!File.Exists(m_strConverterSpec))
                {
                    LoginSF.CreateCCTable(m_strConverterSpec, SpellFixerEncConverterName, PunctuationAndWhiteSpace, null, !this.m_bLegacy);
                }

                // if it was legacy encoded, then we need to convert the data to narrow using
                //  the code page the user specified (or we got out of the repository)
                Encoding  enc = GetEncoding;
                DataTable myTable;
                if (InitializeDataTableFromCCTable(m_strConverterSpec, enc, WordBoundaryDelimiter, out myTable))
                {
                    // now put up an editable grid with this data.
                    DialogResult res = DialogResult.Cancel;
                    try
                    {
                        ViewBadGoodPairsDlg dlg = new ViewBadGoodPairsDlg(myTable, m_font);
                        res = dlg.ShowDialog();
                    }
#if DEBUG
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, SpellingFixerEC.cstrCaption);
                    }
#else
                    catch { }
#endif

                    if (res == DialogResult.OK)
                    {
                        LoginSF.ReWriteCCTableHeader(m_strConverterSpec, PunctuationAndWhiteSpace, enc);
                        AppendCCTableFromDataTable(m_strConverterSpec, enc, WordBoundaryDelimiter, PunctuationAndWhiteSpace, myTable);
                    }
                }
            }
        }
Пример #2
0
		public void EditSpellingFixes()
		{
			if (m_strConverterSpec != null)
			{
				// Open the CC table that has the mappings and put them in a DataTable.
				if (!File.Exists(m_strConverterSpec))
				{
					LoginSF.CreateCCTable(m_strConverterSpec, SpellFixerEncConverterName, PunctuationAndWhiteSpace, null, !this.m_bLegacy);
				}

				// if it was legacy encoded, then we need to convert the data to narrow using
				//  the code page the user specified (or we got out of the repository)
				Encoding enc = GetEncoding;
				DataTable myTable;
				if (InitializeDataTableFromCCTable(m_strConverterSpec, enc, WordBoundaryDelimiter, out myTable))
				{
					// now put up an editable grid with this data.
					DialogResult res = DialogResult.Cancel;
					try
					{
						ViewBadGoodPairsDlg dlg = new ViewBadGoodPairsDlg(myTable, m_font);
						res = dlg.ShowDialog();
					}
#if DEBUG
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message, SpellingFixerEC.cstrCaption);
					}
#else
					catch { }
#endif

					if (res == DialogResult.OK)
					{
						LoginSF.ReWriteCCTableHeader(m_strConverterSpec, PunctuationAndWhiteSpace, enc);
						AppendCCTableFromDataTable(m_strConverterSpec, enc, WordBoundaryDelimiter, PunctuationAndWhiteSpace, myTable);
					}
				}
			}
		}