Bug 630296 - Add 'network status' support for Windows.
Add 'network status' support for Windows.
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Windows
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-09-21 21:53 UTC by Peter Johanson
Modified: 2010-09-22 18:19 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement network status support for windows. (7.19 KB, patch)
2010-09-21 21:53 UTC, Peter Johanson
needs-work Details | Diff | Review
Updated patch with fixes (7.21 KB, patch)
2010-09-22 18:12 UTC, Peter Johanson
committed Details | Diff | Review

Description Peter Johanson 2010-09-21 21:53:18 UTC
Created attachment 170791 [details] [review]
Implement network status support for windows.

The following patch adds support for detecting the network status (connected or not) on Windows, using the classes from the System.Net.NetworkInformation namespace.
Comment 1 Gabriel Burt 2010-09-22 16:59:39 UTC
Review of attachment 170791 [details] [review]:

Looks pretty good - I have a few nitpicks.

::: src/Core/Banshee.Services/Banshee.Networking/DotNetNetworking.cs
@@ +35,3 @@
+    public class DotNetNetworking : INetworkAvailabilityService
+    {
+        public static bool Available { get { try { return Type.GetType ("Mono.Runtime") == null; } catch { return true; } } }

Might as well call this ManagerPresent like the others do, no?

@@ +40,3 @@
+
+        public State State
+        {

put this { up on the previous line (for properties)

@@ +59,3 @@
+        void OnNetworkAvailabilityChanged (object o, NetworkAvailabilityEventArgs args)
+        {
+            StateChangeHandler sc = StateChange;

rewrite this as
var handler = StateChanged;
if (handler != null) {
...
}
Comment 2 Peter Johanson 2010-09-22 18:12:30 UTC
Created attachment 170850 [details] [review]
Updated patch with fixes

Updated based on feedback.
Comment 3 Gabriel Burt 2010-09-22 18:19:20 UTC
Review of attachment 170850 [details] [review]:

Committed, thanks!

Note You need to log in before you can comment on or make changes to this bug.