Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
/ Netify Public archive

Instantly get notified when the network connection changes (Windows Only).

License

Notifications You must be signed in to change notification settings

AmRo045/Netify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netify icon

Netify

Instantly get notified when the network connection changes.

Installation

You can add Netify to your project using .NET CLI:

dotnet add package Netify

or NuGet package manager console:

Install-Package Netify

Example Usage

using Netify;
using static System.Console;

var networkStatusNotifier = new NetworkStatusNotifier();
var sampleApp = new SampleApp(networkStatusNotifier);

networkStatusNotifier.Start();
sampleApp.DoSomething();
networkStatusNotifier.Stop();

internal class SampleApp : INetworkObserver
{
    public SampleApp(INetworkStatusNotifier networkStatusNotifier)
    {
        networkStatusNotifier.AddObserver(this);
    }

    public void ConnectivityChanged(ConnectivityStatus status)
    {
        WriteLine($"Connectivity status changed: {status}");
    }

    public void DoSomething()
    {
        WriteLine("Change your connection status to see app reaction.");
        ReadKey();
    }
}

Supported Platforms

  • Windows

Demo App

Netify Demo App - Connected Netify Demo App - Disconnected