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) }); }
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); }