コード例 #1
0
        /// <summary>
        /// Initializes the this instance.
        /// </summary>
        /// <param name="context">The context.</param>
        private void Initialize(IExecutionContext context)
        {
            if (!m_initialized)
            {
                //
                // Add event handlers
                //

                // Cache entered OIDs
                context.FilterManager.FilteringStartedEvent +=
                    delegate(IExecutionContext log)
                {
                    if (IsFilterActive)
                    {
                        ListBoxOid[] oids = new ListBoxOid[allowedOidListBox.Items.Count];
                        int          i    = 0;
                        foreach (ListBoxOid oid in allowedOidListBox.Items)
                        {
                            oids[i++] = oid;
                        }
                        m_selectedOidsCache = oids;
                    }
                };

                // Clear cached OIDs
                context.FilterManager.FilteringStoppedEvent +=
                    delegate(IExecutionContext log)
                {
                    m_selectedOidsCache = null;
                };


                // Initialization finished successfully
                m_initialized = true;
            }
        }
コード例 #2
0
 /// <summary>
 /// Checks the oid.
 /// </summary>
 /// <param name="oid">The oid.</param>
 /// <returns></returns>
 protected abstract bool CheckOid(ListBoxOid oid);