Inheritance: System.Windows.Forms.Form
コード例 #1
0
        private void BtnAddFilter_Click(object sender, EventArgs e)
        {
            DataGridViewCell cell = dgvResults.SelectedCells.Cast <DataGridViewCell>().FirstOrDefault();

            if (cell == null)
            {
                MessageBox.Show("Select a message to base the filter on");
                return;
            }
            LogMessage message = dgvResults["Object", cell.RowIndex].Value as LogMessage;

            using (var win = new FilterEditorDialog(message, new LogMessageFilter()))
            {
                if (win.ShowDialog() == DialogResult.OK)
                {
                    LstFilters.Items.Add(win.FilterResult);
                    m_filters.Add(win.FilterResult);
                    RefreshFilters();
                }
            }
        }
コード例 #2
0
        private void LstFilters_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (LstFilters.SelectedItem != null)
            {
                DataGridViewCell cell = dgvResults.SelectedCells.Cast <DataGridViewCell>().FirstOrDefault();
                if (cell == null)
                {
                    MessageBox.Show("Select a message to base the edits on");
                    return;
                }
                LogMessage message = dgvResults["Object", cell.RowIndex].Value as LogMessage;

                using (var win = new FilterEditorDialog(message, (LogMessageFilter)LstFilters.SelectedItem))
                {
                    if (win.ShowDialog() == DialogResult.OK)
                    {
                        m_filters[LstFilters.SelectedIndex]        = win.FilterResult;
                        LstFilters.Items[LstFilters.SelectedIndex] = win.FilterResult;
                        RefreshFilters();
                    }
                }
            }
        }