public void Delete() { if (ToDeleteInterfaces.Count != 0) { foreach (var interfaceProfile in ToDeleteInterfaces) { DeleteInterfaceProfiles(interfaceProfile); InterfaceProfiles.Remove(interfaceProfile); } } UpdateInterfaceProfileListKey(); if (ToDeleteNetworks.Count != 0) { foreach (var networkProfile in ToDeleteNetworks) { DeleteNetworkProfiles(networkProfile); NetworkProfiles.Remove(networkProfile); } } // Clear trackers ToDeleteInterfaces.Clear(); ToDeleteNetworks.Clear(); }
public void LoadAll() { // Clear collections so no duplicate InterfaceProfiles.Clear(); NetworkProfiles.Clear(); ToDeleteInterfaces.Clear(); ToDeleteNetworks.Clear(); // Load all interfaces GetInterfaces(); GetNetworks(); }
public void NetworkUnchecked(RoutedEventArgs e) { var item = e.Source as CheckBox; if (item == null) { return; } var profile = item.DataContext as NetworkProfile; if (profile != null && ToDeleteNetworks.Contains(profile)) { ToDeleteNetworks.Remove(profile); } }