Example #1
0
        /// <summary>
        /// Called when a change occurs to the underlying real index.
        /// Just reports to any upstream objects.
        /// </summary>
        /// <param name="source">Should be the real index.</param>
        /// <param name="e">Identifies the change.</param>
        private void ErrorIndexUpdated(Object source, ErrorIndexEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (e.ChangeInformation == null)
            {
                throw new ArgumentException("Change information is invalid", "e");
            }

            if (e.ChangeInformation.TypeOfChange == StackHashChangeType.NewEntry)
            {
                switch (e.ChangeInformation.DataThatChanged)
                {
                case StackHashDataChanged.Product:
                    m_Statistics.Products++;

                    // New products should be enabled automatically if requested.
                    if (shouldEnableNewProductsAutomatically())
                    {
                        // Check if auto product enabling is enabled.
                        StackHashProductSyncData productToSync = new StackHashProductSyncData((int)e.ChangeInformation.ProductId);
                        m_TaskParameters.SettingsManager.SetProductSyncData(m_TaskParameters.ContextId, productToSync);
                    }
                    break;

                case StackHashDataChanged.File:
                    m_Statistics.Files++;
                    break;

                case StackHashDataChanged.Event:
                    m_Statistics.Events++;
                    break;

                case StackHashDataChanged.Hit:
                    m_Statistics.EventInfos++;
                    break;

                case StackHashDataChanged.Cab:
                    m_Statistics.Cabs++;
                    break;
                }
            }
        }
Example #2
0
 /// <summary>
 /// Called when a change occurs to the underlying real index.
 /// Triggers the main thread to actually process the Update Table.
 /// </summary>
 /// <param name="source">Should be the real index.</param>
 /// <param name="e">Identifies the change.</param>
 private void ErrorIndexUpdated(Object source, ErrorIndexEventArgs e)
 {
     m_Events[s_UpdateArrived].Set();
 }