Exemplo n.º 1
0
        internal ViewBadGoodPairsDlg(CscProject project, ref KnownGoodWordList mapWhiteList,
                                     ref Bad2GoodMap mapBad2Good, Font font, bool bEditingWhiteList)
        {
            InitializeComponent();

            m_project           = project;
            m_mapWhiteList      = mapWhiteList;
            m_mapBad2Good       = mapBad2Good;
            m_bEditingWhiteList = bEditingWhiteList;

            this.dataGridView.RowsDefaultCellStyle.Font = font;
            dataGridView.RowTemplate.Height             = font.Height + 6; // 6 for padding

            if (bEditingWhiteList)
            {
                this.Text = "Edit Dictionary";
                this.helpProvider.SetHelpString(dataGridView, Properties.Resources.ViewBadGoodPairsDictionaryHelp);
                dataGridView.Columns[cnGoodSpelling].HeaderText = "Known Good Words";
                dataGridView.Columns[cnBadSpelling].Visible     = false;

                object[] ao = new object[2];
                ao[cnBadSpelling] = null;
                foreach (string strKey in mapWhiteList.Keys)
                {
                    ao[cnGoodSpelling] = strKey;
                    dataGridView.Rows.Add(ao);
                }
            }
            else
            {
                helpProvider.SetHelpString(dataGridView, Properties.Resources.ViewBadGoodPairsBad2GoodHelp);

                object[] ao = new object[2];
                foreach (KeyValuePair <string, string> kvp in mapBad2Good)
                {
                    ao[cnBadSpelling]  = kvp.Key;
                    ao[cnGoodSpelling] = kvp.Value;
                    dataGridView.Rows.Add(ao);
                }
            }
        }
Exemplo n.º 2
0
		internal ViewBadGoodPairsDlg(CscProject project, ref KnownGoodWordList mapWhiteList,
			ref Bad2GoodMap mapBad2Good, Font font, bool bEditingWhiteList)
		{
			InitializeComponent();

			m_project = project;
			m_mapWhiteList = mapWhiteList;
			m_mapBad2Good = mapBad2Good;
			m_bEditingWhiteList = bEditingWhiteList;

			this.dataGridView.RowsDefaultCellStyle.Font = font;
			dataGridView.RowTemplate.Height = font.Height + 6;   // 6 for padding

			if (bEditingWhiteList)
			{
				this.Text = "Edit Dictionary";
				this.helpProvider.SetHelpString(dataGridView, Properties.Resources.ViewBadGoodPairsDictionaryHelp);
				dataGridView.Columns[cnGoodSpelling].HeaderText = "Known Good Words";
				dataGridView.Columns[cnBadSpelling].Visible = false;

				object[] ao = new object[2];
				ao[cnBadSpelling] = null;
				foreach (string strKey in mapWhiteList.Keys)
				{
					ao[cnGoodSpelling] = strKey;
					dataGridView.Rows.Add(ao);
				}
			}
			else
			{
				helpProvider.SetHelpString(dataGridView, Properties.Resources.ViewBadGoodPairsBad2GoodHelp);

				object[] ao = new object[2];
				foreach (KeyValuePair<string,string> kvp in mapBad2Good)
				{
					ao[cnBadSpelling] = kvp.Key;
					ao[cnGoodSpelling] = kvp.Value;
					dataGridView.Rows.Add(ao);
				}
			}
		}