Beispiel #1
0
        private NetworkComboBoxItem CreateNewItem(PIF pif)
        {
            var network = PopulateConnection.Resolve(pif.network);

            return(new NetworkComboBoxItem
            {
                IncludePoolNameInComboBox = IncludePoolNameInComboBox,
                IsManagement = pif.management,
                Network = network,
                NetworkIsConnected = pif.LinkStatus() == PIF.LinkState.Connected,
                HasIPAddress = pif.IsManagementInterface(false)
            });
        }
Beispiel #2
0
        private bool CanShowItem(PIF pif, out NetworkComboBoxItem existingItem)
        {
            existingItem = Items.Cast <NetworkComboBoxItem>().FirstOrDefault(i => i.Network.opaque_ref == pif.network.opaque_ref);

            if (existingItem != null)
            {
                return(false);
            }

            if (ExcludeDisconnectedNetworks && pif.LinkStatus() != PIF.LinkState.Connected)
            {
                return(false);
            }

            if (ExcludeNetworksWithoutIpAddresses && !pif.IsManagementInterface(false))
            {
                return(false);
            }

            return(true);
        }