XenAdmin.Wizards.PatchingWizard.PatchingWizard_SelectServers.AllSelectedHostsConnected C# (CSharp) Method

AllSelectedHostsConnected() private method

private AllSelectedHostsConnected ( ) : bool
return bool
        private bool AllSelectedHostsConnected()
        {
            var disconnectedServerNames = new List<string>();

            foreach (PatchingHostsDataGridViewRow row in dataGridViewHosts.Rows)
            {
                if ((int)row.Cells[POOL_CHECKBOX_COL].Value > UNCHECKED && ((row.Tag is Host && !row.HasPool) || row.Tag is Pool))
                {
                    IXenConnection connection = ((IXenObject) row.Tag).Connection;
                    if (connection == null || !connection.IsConnected)
                        disconnectedServerNames.Add(((IXenObject) row.Tag).Name);
                }
            }

            if (disconnectedServerNames.Count > 0)
            {
                using (var dlg = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Warning,
                        string.Format(Messages.UPDATES_WIZARD_DISCONNECTED_SERVER, Helpers.StringifyList(disconnectedServerNames)),
                        Messages.UPDATES_WIZARD)))
                {
                    dlg.ShowDialog(this);
                }
                return false;
            }
            return true;
        }