Beispiel #1
0
        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public EventFilter ShowDialog(Session session, EventFilter filter, bool editWhereClause)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            m_session = session;
            m_filter  = filter;

            BrowseCTRL.SetView(m_session, BrowseViewType.EventTypes, null);
            SelectClauseCTRL.Initialize(session, filter.SelectClauses);
            ContentFilterCTRL.Initialize(session, filter.WhereClause);
            FilterOperandsCTRL.Initialize(session, null, -1);

            MoveBTN_Click((editWhereClause)?NextBTN:BackBTN, null);

            if (ShowDialog() != DialogResult.OK)
            {
                return(null);
            }

            return(m_filter);
        }
Beispiel #2
0
        private void ContentFilterCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                if (e.Items.Count > 0)
                {
                    foreach (object item in e.Items)
                    {
                        List <ContentFilterElement> elements = ContentFilterCTRL.GetElements();

                        for (int ii = 0; ii < elements.Count; ii++)
                        {
                            if (Object.ReferenceEquals(elements[ii], item))
                            {
                                FilterOperandsCTRL.Initialize(m_session, elements, ii);
                            }
                        }

                        break;
                    }
                }
                else
                {
                    FilterOperandsCTRL.Initialize(m_session, null, -1);
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }