home links tools blog about
home

« Web Dev Call to Arms: The idiots at Google are back at it... | Main | Breaking ClickOnce, + ClickOnce and Embedded Files »

October 25, 2005

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341ce4d453ef00d834964cf269e2

Listed below are links to weblogs that reference Abstraction and System.Net.NetworkNotification:

Comments

Chad

I have a quick question on this: In your method:

private void ClassThatNeedsNetworkNotification_Load(
object sender, EventArgs e)
{
this._networkStatus = new NetworkStatus();
ConnectionStatus status = this._networkStatus.ConnectivityStatus;
this.BindConnectionStatus(status);
this._networkStatus.NetworkStatusChanged
+= new NetworkStatusChangedEventHandler(NetworkStatusChanged);

// other wire up as needed
}

What/where is code the method for this.BindConnectionStatus(status);?? What does it do?

Thanks!

Michael K. Campbell

Chad,

That's just a super simple method that takes the status (an enum) and 'binds' it to the winform, or whatever else you've got that is consuming this class.

For example... say I was building a simple winform with a status bar. Upon loading the winform, the constructor would instantiate a new NetworkStatus class, grab the current status (connected or offline), and send that to the BindStatus(status) method. The BindStatus method could then either toggle icons, or display text such as: Online, or Offline so that the user would know their status (if they didn't already).

(i.e. it's really nothing).

Björn Waide

Hi Michael,

first off all thanks a lot for providing this great NetworkStatus class. Unfortunatley, when using it in one of my projects I experienced that it was not working in some circumstances. After some research I found an explanation on MSDN. The NetworkAvailabilityChanged event uses also the static GetIsNetworkAvailable() method to determine the network status, but unfortunately this method returns true whenever one of the available network adapters is up and running and its type is not "loopback" or "tunnel". But this behavior will cause problems on machines with VMWare installed, because VMWare installs at least two additional NetworkAdapters that - unless they are deactivated - are always "Up", even if there is no "real" NetworkAdapter connected. Because I read that you are also a fan of VMWare I hope you have also noticed that problem and developed a solution already?! :-)

Regards, Bjoern

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.