Ejemplo n.º 1
0
 /// <summary>
 ///     Dispose implementation which ensures the native window is destroyed, and
 ///     managed resources detached.
 /// </summary>
 private void Dispose(bool disposeManaged)
 {
     if (!disposed)
     {
         lock (disposeLock)
         {
             if (!disposed)
             {
                 disposed = true;
                 subscriptionService.Dispose();
                 if (disposeManaged)
                 {
                     if (MessageReceived != null)
                     {
                         // remove all handlers
                         var del = MessageReceived.GetInvocationList();
                         foreach (Listeners.XDMessageHandler msg in del)
                         {
                             MessageReceived -= msg;
                         }
                     }
                 }
             }
         }
     }
 }
        private void Dispose(bool disposeManaged)
        {
            if (disposed)
            {
                return;
            }

            lock (disposeLock)
            {
                if (disposed)
                {
                    return;
                }

                disposed = true;
                subscriptionService.Dispose();
                if (!disposeManaged || MessageReceived == null)
                {
                    return;
                }

                var del = MessageReceived.GetInvocationList();
                foreach (var item in del)
                {
                    var msg = (Listeners.XDMessageHandler)item;
                    MessageReceived -= msg;
                }
            }
        }
Ejemplo n.º 3
0
 public static void CleanUp()
 {
     if (_subscriptionService != null)
     {
         _subscriptionService.Dispose();
     }
 }
Ejemplo n.º 4
0
 protected override void OnDisposed()
 {
     _subscriptionService.Dispose();
 }