/// <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>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(); } } }
/// <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(); } } }