Beispiel #1
0
 /// <summary>
 /// This method Unregisters the clear callback
 /// </summary>
 /// <param name="callback">A delegate to register your custom method with</param>
 /// <example>
 /// Lets consider we registered a ClearNotification
 /// <code>
 ///  public static void CacheCleared()
 ///   {
 ///     ...
 ///   }
 /// </code>
 /// Then unregister your notification callback
 /// <code>
 /// cQ.UnRegisterClearNotification(new ContinuousQueryClearCallback(CacheCleared));
 /// </code>
 /// </example>
 public void UnRegisterClearNotification(ContinuousQueryClearCallback callback)
 {
     if (callback != null)
     {
         _cacheCleared -= callback;
     }
 }
Beispiel #2
0
        internal void OnCacheCleared()
        {
            if (_cacheCleared != null)
            {
                Delegate[] dltList = _cacheCleared.GetInvocationList();
                for (int i = dltList.Length - 1; i >= 0; i--)
                {
                    ContinuousQueryClearCallback subscriber = (ContinuousQueryClearCallback)dltList[i];

                    try
                    {
                        subscriber();
                    }
                    catch (Exception e)
                    {
                    }
                }
            }
        }