private void UpdateDisabilitaServizioButton()
 {
     if (Properties.Settings.Default.Disabled)
     {
         Disabilita.Content = "Abilita il servizio";
         Risultato.Text     = "Servizio disabilitato.".Dateify();
     }
     else
     {
         Disabilita.Content = "Disabilita il servizio";
         AutoConnector.Connect();
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.Username = Username.Text;
            Properties.Settings.Default.Password = Password.Password;
            Properties.Settings.Default.Save();

            if (string.IsNullOrEmpty(Username.Text) || string.IsNullOrEmpty(Password.Password))
            {
                SaveButton.Content = "Salva e abilita";
                return;
            }

            SaveButton.Content    = "Salvato!";
            SaveButton.FontWeight = FontWeights.Normal;
            AutoConnector.Connect();
        }
 public void GetStatistics()
 {
     try
     {
         var m = MainWindow.Instance;
         m.ConnessoAWifi.Content       = wifi.ConnectionStatus;
         m.InterfacciaConnessa.Content = wlan.Interfaces?.First()?.InterfaceState != WlanInterfaceState.Disconnected;
         m.ConnessoAdInternet.Content  = AutoConnector.CheckForInternetConnection();
         if (wlan.Interfaces.First().InterfaceState != WlanInterfaceState.Disconnected)
         {
             m.ConnessoAdErgoRum.Content = wlan.Interfaces.Any(x => x.CurrentConnection.profileName == "ergo-rum");
             m.Segnale.Content           = wlan.Interfaces?.First()?.CurrentConnection.wlanAssociationAttributes.wlanSignalQuality + "/100";
             m.Sicurezza.Content         = wlan.Interfaces?.First()?.CurrentConnection.wlanSecurityAttributes.securityEnabled;
         }
         else
         {
             m.ConnessoAdErgoRum.Content = false;
             m.Segnale.Content           = "non connesso";
             m.Sicurezza.Content         = false;
         }
         m.ConnessioneSpeed.Content = bytesPerSecond < 0 ? "0B" : bytesPerSecond.ToPrettySize();
     }
     catch { }
 }
 private void dispatcherTimer_Tick(object sender, EventArgs e)
 {
     AutoConnector.Connect();
 }