Beispiel #1
0
        private void updateList()
        {
            PIFRow selected = null;

            if (dataGridView1.SelectedRows.Count > 0)
            {
                selected = dataGridView1.SelectedRows[0] as PIFRow;
            }

            try
            {
                dataGridView1.SuspendLayout();
                dataGridView1.Rows.Clear();

                if (host != null)
                {
                    foreach (PIF PIF in host.Connection.ResolveAll(host.PIFs))
                    {
                        if (!PIF.IsPhysical())
                        {
                            continue;
                        }

                        RegisterPIFEventHandlers(PIF);

                        PIFRow p = new PIFRow(PIF);
                        dataGridView1.Rows.Add(p);
                        if (selected != null && p.pif == selected.pif)
                        {
                            p.Selected = true;
                        }
                    }

                    //show the FCoE column for Dundee or higher hosts only
                    ColumnFCoECapable.Visible = Helpers.DundeeOrGreater(host);

                    //show the SR-IOV column for Kolkata or higher hosts only
                    ColumnSriovCapable.Visible = Helpers.KolkataOrGreater(host);

                    //CA-47050: the Device column should be autosized to Fill, but should not become smaller than a minimum
                    //width, which here is chosen to be the column header width. To find what this width is
                    //set temporarily the column's autosize mode to ColumnHeader.
                    ColumnDeviceName.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;
                    int storedWidth = ColumnDeviceName.Width;
                    ColumnDeviceName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                    ColumnDeviceName.MinimumWidth = storedWidth;

                    if (dataGridView1.SortedColumn != null)
                    {
                        dataGridView1.Sort(dataGridView1.SortedColumn, dataGridView1.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending);
                    }
                }
            }
            finally
            {
                dataGridView1.ResumeLayout();
            }
        }
Beispiel #2
0
        private void updateList()
        {
            PIFRow selected = null;

            if (dataGridView1.SelectedRows.Count > 0)
            {
                selected = dataGridView1.SelectedRows[0] as PIFRow;
            }

            try
            {
                dataGridView1.SuspendLayout();
                dataGridView1.Rows.Clear();

                if (host != null)
                {
                    foreach (PIF PIF in host.Connection.ResolveAll(host.PIFs))
                    {
                        if (!PIF.IsPhysical())
                        {
                            continue;
                        }

                        RegisterPIFEventHandlers(PIF);

                        PIFRow p = new PIFRow(PIF);
                        dataGridView1.Rows.Add(p);
                        if (selected != null && p.Pif == selected.Pif)
                        {
                            p.Selected = true;
                        }
                    }

                    //show the FCoE column for Dundee or higher hosts only
                    ColumnFCoECapable.Visible = Helpers.DundeeOrGreater(host);

                    //show the SR-IOV column for Kolkata or higher hosts only
                    ColumnSriovCapable.Visible = Helpers.KolkataOrGreater(host);

                    HelpersGUI.ResizeGridViewColumnToHeader(ColumnDeviceName);
                    HelpersGUI.ResizeGridViewColumnToHeader(ColumnSriovCapable);

                    if (dataGridView1.SortedColumn != null)
                    {
                        dataGridView1.Sort(dataGridView1.SortedColumn, dataGridView1.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending);
                    }
                }
            }
            finally
            {
                dataGridView1.ResumeLayout();
            }
        }
Beispiel #3
0
            public void UpdateDetails()
            {
                Enabled = !Network.IsSlave();

                DeregisterPifEvents();

                Pif = Helpers.FindPIF(Network, Xmo as Host);

                RegisterPifEvents();

                ImageCell.Value       = Properties.Resources._000_Network_h32bit_16;
                NameCell.Value        = NetworkName();
                DescriptionCell.Value = Network.Description();
                NicCell.Value         = Helpers.GetName(Pif);
                VlanCell.Value        = Helpers.VlanString(Pif);
                AutoCell.Value        = Network.GetAutoPlug() ? Messages.YES : Messages.NO;
                LinkStatusCell.Value  = Xmo is Pool?Network.LinkStatusString() :
                                            Pif == null ? Messages.NONE : Pif.LinkStatusString();

                MacCell.Value = Pif != null && Pif.IsPhysical() ? Pif.MAC : Messages.SPACED_HYPHEN;
                MtuCell.Value = Network.CanUseJumboFrames() ? Network.MTU.ToString() : Messages.SPACED_HYPHEN;
            }
Beispiel #4
0
            public void UpdateDetails()
            {
                Enabled = !Network.IsSlave();

                DeregisterPifEvents();

                Pif = Helpers.FindPIF(Network, Xmo as Host);

                RegisterPifEvents();

                ImageCell.Value       = Properties.Resources._000_Network_h32bit_16;
                NameCell.Value        = NetworkName();
                DescriptionCell.Value = Network.Description();
                NicCell.Value         = Helpers.GetName(Pif);
                VlanCell.Value        = Helpers.VlanString(Pif);
                AutoCell.Value        = Network.GetAutoPlug() ? Messages.YES : Messages.NO;
                LinkStatusCell.Value  = Xmo is Pool?Network.LinkStatusString() :
                                            Pif == null ? Messages.NONE : Pif.LinkStatusString();

                MacCell.Value = Pif != null && Pif.IsPhysical() ? Pif.MAC : Messages.SPACED_HYPHEN;
                MtuCell.Value = Network.CanUseJumboFrames() ? Network.MTU.ToString() : Messages.SPACED_HYPHEN;

                var networkSriov = Pif != null?Pif.NetworkSriov() : null;

                if (networkSriov == null)
                {
                    SriovCell.Value = Messages.NO;
                }
                else
                {
                    var sriov = Pif.Connection.Resolve(networkSriov);
                    SriovCell.Value = sriov == null
                        ? Messages.NO
                        : sriov.requires_reboot
                            ? Messages.HOST_NEEDS_REBOOT_ENABLE_SRIOV
                            : Messages.YES;
                }
            }
Beispiel #5
0
 // Can the network's NIC, SR-IOV network and VLAN be edited?
 private bool Editable(PIF pif)
 {
     return(pif == null || (!pif.IsPhysical() && !pif.IsTunnelAccessPIF() && (pif.sriov_logical_PIF_of == null || pif.sriov_logical_PIF_of.Count == 0)));
 }
Beispiel #6
0
 // Can the network's NIC and VLAN be edited?
 private bool Editable(PIF pif)
 {
     return(pif == null || (!pif.IsPhysical() && !pif.IsTunnelAccessPIF()));
 }