コード例 #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Clicked the ADD button.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (var dlg = new AddCharacterDlg(null))
     {
         if (dlg.ShowDialog(this) == DialogResult.OK && dlg.Symbol != null)
         {
             m_symbols.Add(dlg.Symbol);
             Grid.RowCount++;
             m_dirty = true;
             SortList(dlg.Symbol);
         }
     }
 }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Clicked the MODIFY button.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void btnModify_Click(object sender, EventArgs e)
        {
            int i = Grid.CurrentCellAddress.Y;

            if (i < 0 || i >= m_symbols.Count)
            {
                return;
            }

            using (var dlg = new AddCharacterDlg(m_symbols[i]))
            {
                if (dlg.ShowDialog(this) != DialogResult.OK || dlg.Symbol == null)
                {
                    return;
                }

                m_symbols[i] = dlg.Symbol;
                m_dirty      = true;
                SortList(m_symbols[i]);
            }
        }