Ejemplo n.º 1
0
 public void DeleteProfile(WirelessInterface wirelessInterface, Profile profile)
 {
     using (var wirelessManager = new WirelessManager())
     {
         wirelessManager.DeleteProfile(wirelessInterface, profile);
     }
 }
Ejemplo n.º 2
0
        public async Task<ObservableCollection<WirelessInterfaceWithProfiles>> GetWirelessInterfacesAndTheirProfilesAsync()
        {
            using (var wirelessManager = new WirelessManager())
            {
                // ReSharper disable once AccessToDisposedClosure
                return new ObservableCollection<WirelessInterfaceWithProfiles>(await Task.Run(() =>
                                                                                              {
                                                                                                  List<WirelessInterface> allInterfaces = wirelessManager.GetAvailableWirelessInterfaces();

                                                                                                  // get all their profiles
                                                                                                  List<WirelessInterfaceWithProfiles> interfacesWithProfiles = allInterfaces
                                                                                                      .Select(e => new WirelessInterfaceWithProfiles(e, new ObservableCollection<Profile>(wirelessManager.GetProfilesForWirelessInterface(e))))
                                                                                                      .ToList();

                                                                                                  return interfacesWithProfiles;
                                                                                              }));
            }
        }