Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public void LoadAll()
        {
            // Clear collections so no duplicate
            InterfaceProfiles.Clear();
            NetworkProfiles.Clear();
            ToDeleteInterfaces.Clear();
            ToDeleteNetworks.Clear();

            // Load all interfaces
            GetInterfaces();
            GetNetworks();
        }
Exemplo n.º 3
0
        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);
            }
        }