private bool ShowNetwork(Host targetHost, XenAPI.Network network)
        {
            if (!network.Show(Properties.Settings.Default.ShowHiddenVMs))
                return false;

            if (network.IsSlave)
                return false;

            if (targetHost != null && !targetHost.CanSeeNetwork(network))
                return false;

            if (targetHost == null && !network.AllHostsCanSeeNetwork)
                return false;

            return true;
        }
 private XenAPI.Network GetANetwork(Host host)
 {
     return host.Connection.Cache.Networks.FirstOrDefault(network => host.CanSeeNetwork(network));
 }