/// <summary>Remove Network Reachability Listener</summary>
 public virtual void RemoveNetworkReachabilityListener(NetworkReachabilityListener
      listener)
 {
     lock (this)
     {
         if (networkReachabilityListeners == null)
         {
             networkReachabilityListeners = new AList<NetworkReachabilityListener>();
         }
         networkReachabilityListeners.Remove(listener);
         if (networkReachabilityListeners.Count == 0)
         {
             StopListening();
         }
     }
 }
示例#2
0
 /// <summary>Remove Network Reachability Listener</summary>
 public virtual void RemoveNetworkReachabilityListener(NetworkReachabilityListener
                                                       listener)
 {
     lock (this)
     {
         if (networkReachabilityListeners == null)
         {
             networkReachabilityListeners = new AList <NetworkReachabilityListener>();
         }
         networkReachabilityListeners.Remove(listener);
         if (networkReachabilityListeners.Count == 0)
         {
             StopListening();
         }
     }
 }
 /// <summary>Add Network Reachability Listener</summary>
 public virtual void AddNetworkReachabilityListener(NetworkReachabilityListener listener
     )
 {
     lock (this)
     {
         if (networkReachabilityListeners == null)
         {
             networkReachabilityListeners = new AList<NetworkReachabilityListener>();
         }
         int numListenersBeforeAdd = networkReachabilityListeners.Count;
         networkReachabilityListeners.AddItem(listener);
         if (numListenersBeforeAdd == 0)
         {
             StartListening();
         }
     }
 }
示例#4
0
 /// <summary>Add Network Reachability Listener</summary>
 public virtual void AddNetworkReachabilityListener(NetworkReachabilityListener listener
                                                    )
 {
     lock (this)
     {
         if (networkReachabilityListeners == null)
         {
             networkReachabilityListeners = new AList <NetworkReachabilityListener>();
         }
         int numListenersBeforeAdd = networkReachabilityListeners.Count;
         networkReachabilityListeners.AddItem(listener);
         if (numListenersBeforeAdd == 0)
         {
             StartListening();
         }
     }
 }