Ejemplo n.º 1
0
 public VendorRow(string vendor)
 {
     Cells.AddRange(new DataGridViewCheckBoxCellVendor(),
                    new DataGridViewTextBoxCell {
         Value = vendor
     },
                    new DataGridViewTextBoxCell(),
                    new DataGridViewTextBoxCell(),
                    new DataGridViewTextBoxCell());
 }
Ejemplo n.º 2
0
        public VGpuTypeRow(VGPU_type vGpuType, bool enabledType)
        {
            VGpuType    = vGpuType;
            EnabledType = enabledType;

            Cells.AddRange(ImageCell,
                           NameCell);

            UpdateDetails();
        }
Ejemplo n.º 3
0
        public VGpuDetailWithCheckBoxRow(XenRef <VGPU_type> vGpuTypeRef, VGPU_type vGpuType, bool allowed, bool isInUse)
        {
            VGpuTypeRef  = vGpuTypeRef;
            VGpuType     = vGpuType;
            this.allowed = allowed;
            this.isInUse = isInUse;

            Cells.AddRange(checkBoxCell, nameColumn, vGpusPerGpuColumn, maxResolutionColumn, maxDisplaysColumn, videoRamColumn);
            SetCells();
        }
Ejemplo n.º 4
0
            public VmPrecheckRow(EvacuateHostDialog dialog, VM vm)
            {
                this.dialog   = dialog;
                this.vm       = vm;
                this.error    = "";
                this.solution = Solution.None;

                Cells.AddRange(cellImage, cellVm, cellAction);
                Update();
            }
            public PatchGridViewRow(XenServerPatchAlert alert)
            {
                _alert = alert;
                Cells.AddRange(_nameCell, _descriptionCell, _dateCell, _webPageCell);

                _nameCell.Value        = String.Format(alert.Name);
                _descriptionCell.Value = String.Format(alert.Description);
                _dateCell.Value        = HelpersGUI.DateTimeToString(alert.Timestamp.ToLocalTime(), Messages.DATEFORMAT_DMY,
                                                                     true);
                _webPageCell.Value = Messages.PATCHING_WIZARD_WEBPAGE_CELL;
            }
Ejemplo n.º 6
0
        private void CreateCells()
        {
            ImageCell           = new DataGridViewImageCell(false);
            ImageCell.ValueType = typeof(Image);
            MacCell             = new DataGridViewTextBoxCell();
            NetworkCell         = new DataGridViewTextBoxCell();

            Cells.AddRange(new DataGridViewCell[] { ImageCell, MacCell, NetworkCell });

            UpdateDetails();
        }
Ejemplo n.º 7
0
        private void AddCells()
        {
            ImageCell           = new DataGridViewImageCell(false);
            ImageCell.ValueType = typeof(Image);
            SizeCell            = new DataGridViewTextBoxCell();
            SrCell     = new DataGridViewTextBoxCell();
            SharedCell = new DataGridViewTextBoxCell();

            Cells.AddRange(new DataGridViewCell[] { ImageCell, SrCell, SizeCell, SharedCell });

            UpdateDetails();
        }
Ejemplo n.º 8
0
            public HostUsbRow(PUSB pusb)
            {
                _pusb = pusb;
                SetVm();

                _pusb.PropertyChanged += Pusb_PropertyChanged;

                Cells.AddRange(locationCell,
                               descriptionCell,
                               passthroughCell,
                               vmCell);
                UpdateDetails();
            }
Ejemplo n.º 9
0
            public DataGridViewActionRow(ActionBase action)
            {
                Action = action;

                cancelItem.Click  += ToolStripMenuItemCancel_Click;
                dismissItem.Click += ToolStripMenuItemDismiss_Click;
                goToItem.Click    += ToolStripMenuItemGoTo_Click;
                copyItem.Click    += ToolStripMenuItemCopy_Click;

                MinimumHeight = DataGridViewDropDownSplitButtonCell.MIN_ROW_HEIGHT;
                Cells.AddRange(expanderCell, statusCell, messageCell, locationCell, dateCell, actionCell);
                RefreshSelf();
            }
Ejemplo n.º 10
0
    public PersonRow(Person person)
    {
        Name.Value = person.Name;
        DataGridViewComboBoxCell phones = new DataGridViewComboBoxCell();

        phones.Items.AddRange((DataGridViewComboBoxCell.ObjectCollection)person.Phones);         //add the items from Person.Phones to PersonRow.Phones combobox cell
        Phones = phones;
        DataGridViewComboBoxCell cars = new DataGridViewComboBoxCell();

        cars.Items.AddRange((DataGridViewComboBoxCell.ObjectCollection)person.Cars); //add Person.Cars to PersonRow.Cars combobox cell
        Cars = cars;
        Cells.AddRange(new DataGridViewCell[] { Name, Phones, Cars });               //add cells to the row
    }
Ejemplo n.º 11
0
            public VMRestoreRow(VM vm)
            {
                var iconCell = new DataGridViewImageCell {
                    Value = Images.GetImage16For(vm)
                };
                var nameCell = new DataGridViewTextBoxCell {
                    Value = Helpers.GetName(vm)
                };
                var locationCell = new DataGridViewTextBoxCell {
                    Value = Helpers.GetName(vm.Connection.Resolve(vm.resident_on))
                };

                Cells.AddRange(iconCell, nameCell, locationCell);
            }
Ejemplo n.º 12
0
        private void AddCells()
        {
            ImageCell = new DataGridViewImageCell(false)
            {
                ValueType = typeof(Image)
            };
            NameCell   = new DataGridViewTextBoxCell();
            SizeCell   = new DataGridViewTextBoxCell();
            SrCell     = new DataGridViewTextBoxCell();
            SharedCell = new DataGridViewTextBoxCell();

            Cells.AddRange(ImageCell, NameCell, SrCell, SizeCell, SharedCell);

            UpdateDetails();
        }
Ejemplo n.º 13
0
            public SRRow(SR sr)
            {
                this.sr = sr;
                Cells.AddRange(imageCell,
                               nameCell,
                               descriptionCell,
                               typeCell,
                               sharedCell,
                               usageCell,
                               sizeCell,
                               virtAllocCell);

                sr.PropertyChanged += sr_PropertyChanged;
                UpdateDetails();
            }
Ejemplo n.º 14
0
            public VifRow(VIF vif)
            {
                Vif = vif;

                Cells.AddRange(ImageCell,
                               DeviceCell,
                               MacCell,
                               LimitCell,
                               NetworkCell,
                               IpCell,
                               AttachedCell);

                Vif.PropertyChanged += Server_PropertyChanged;

                UpdateDetails();
            }
        private void SetupCells()
        {
            _poolCheckBoxCell = new DataGridViewCheckBoxCell
            {
                ThreeState         = true,
                TrueValue          = CheckState.Checked,
                FalseValue         = CheckState.Unchecked,
                IndeterminateValue = CheckState.Indeterminate,
            };

            _nameCell = new DataGridViewNameCell();

            Cells.AddRange(_expansionCell, _poolCheckBoxCell, _nameCell);

            SetupAdditionalDetailsColumns();

            UpdateDetails();
        }
Ejemplo n.º 16
0
            public VmWithSettingsRow(VM vm, VM.HA_Restart_Priority?priority)
            {
                cellImage = new DataGridViewImageCell {
                    ValueType = typeof(Image)
                };
                cellVm = new DataGridViewTextBoxCell();
                cellRestartPriority = new DataGridViewTextBoxCell();
                cellStartOrder      = new DataGridViewTextBoxCell();
                cellDelay           = new DataGridViewTextBoxCell();
                cellAgile           = new DataGridViewTextBoxCell();
                Cells.AddRange(cellImage, cellVm, cellRestartPriority, cellStartOrder, cellDelay, cellAgile);

                UpdateVm(vm);
                UpdateRestartPriority(priority);
                UpdateStartOrder(vm.order);
                UpdateStartDelay(vm.start_delay);
                SetAgileCalculating();
            }
Ejemplo n.º 17
0
            public DataSourceGridViewRow(DataSourceItem dataSourceItem, bool displayOnGraph)
            {
                this.dsi = dataSourceItem;
                var displayOnGraphCell = new DataGridViewCheckBoxCell {
                    Value = displayOnGraph
                };
                var datasourceCell = new DataGridViewTextBoxCell {
                    Value = dsi.ToString()
                };
                var typeCell = new DataGridViewTextBoxCell {
                    Value = dsi.DataType.ToStringI18N()
                };
                var colourCell = new DataGridViewTextBoxCell {
                    Value = dsi.Color
                };

                Cells.AddRange(displayOnGraphCell, datasourceCell, typeCell, colourCell);
            }
Ejemplo n.º 18
0
            public NetworkRow(XenAPI.Network network, IXenObject xmo)
            {
                Network = network;
                Xmo     = xmo;

                Cells.AddRange(ImageCell,
                               NameCell,
                               DescriptionCell,
                               NicCell,
                               VlanCell,
                               AutoCell,
                               LinkStatusCell,
                               MacCell,
                               MtuCell);

                Network.PropertyChanged += Server_PropertyChanged;

                Program.Invoke(Program.MainWindow, UpdateDetails);
            }
Ejemplo n.º 19
0
 public PluginRow(PluginDescriptor plugin)
 {
     Plugin    = plugin;
     Error     = plugin.Error;
     HasErrors = !string.IsNullOrEmpty(plugin.Error);
     Cells.AddRange(new DataGridViewCell[]
     {
         new DataGridViewCheckBoxCell {
             Value = plugin.Enabled && !HasErrors
         },
         new DataGridViewTextBoxCell {
             Value = string.IsNullOrEmpty(plugin.Label) ? plugin.Name : plugin.Label
         },
         new DataGridViewTextBoxCell {
             Value = plugin.Organization
         },
         new DataGridViewTextBoxCell {
             Value = plugin.Description
         }
     });
 }
Ejemplo n.º 20
0
            public StorageRow(SRWrapper srw)
            {
                SrWrapper = srw;

                cellImage = new DataGridViewImageCell(false)
                {
                    ValueType = typeof(Image),
                    Value     = Images.GetImage16For(srw.sr)
                };
                cellSr = new DataGridViewTextBoxCell {
                    Value = srw.sr.NameWithoutHost
                };
                cellDescription = new DataGridViewTextBoxCell {
                    Value = srw.sr.Description
                };
                cellComment = new DataGridViewTextBoxCell {
                    Value = srw.ReasonUnsuitable
                };

                Cells.AddRange(new DataGridViewCell[] { cellImage, cellSr, cellDescription, cellComment });
            }
Ejemplo n.º 21
0
        public DiskGridRowItem(IXenConnection connection, VDI vdi, VBD vbd, DiskSource src, SR sourceSr = null)
        {
            _connection = connection;
            Disk        = vdi;
            Device      = vbd;
            SourceSR    = sourceSr;

            if (src != DiskSource.FromCustomTemplate)
            {
                CanDelete = Disk.type == vdi_type.user;
                CanResize = true;
            }

            if (src == DiskSource.FromDefaultTemplate)
            {
                MinSize = Disk.virtual_size;
            }

            Cells.AddRange(ImageCell, NameCell, SrCell, SizeCell, SharedCell);

            UpdateDetails();
        }
Ejemplo n.º 22
0
            public SrRow(SR sr, bool poolMetadataDetected, bool selected)
            {
                Sr = sr;

                var cellTick = new DataGridViewCheckBoxCell {
                    Value = selected
                };
                var cellName = new DataGridViewTextBoxCell {
                    Value = sr.Name()
                };
                var cellDesc = new DataGridViewTextBoxCell {
                    Value = sr.Description()
                };
                var cellType = new DataGridViewTextBoxCell {
                    Value = sr.FriendlyTypeName()
                };
                var cellMetadata = new DataGridViewTextBoxCell {
                    Value = poolMetadataDetected.ToStringI18n()
                };

                Cells.AddRange(cellTick, cellName, cellDesc, cellType, cellMetadata);
            }
Ejemplo n.º 23
0
            public FCDeviceRow(FibreChannelDevice device)
            {
                Device = device;
                string id      = string.IsNullOrEmpty(device.SCSIid) ? device.Path : device.SCSIid;
                string details = String.Format("{0}:{1}:{2}:{3}", device.adapter, device.channel, device.id, device.lun);

                Cells.AddRange(new DataGridViewCheckBoxCell {
                    ThreeState = false, Value = false
                },
                               new DataGridViewTextBoxCell {
                    Value = Util.DiskSizeString(device.Size)
                },
                               new DataGridViewTextBoxCell {
                    Value = device.Serial
                },
                               new DataGridViewTextBoxCell {
                    Value = id
                },
                               new DataGridViewTextBoxCell {
                    Value = details
                });
            }
Ejemplo n.º 24
0
            private void SetupCells()
            {
                _poolCheckBoxCell = new DataGridViewCheckBoxCell {
                    ThreeState = true
                };

                if (IsPoolOrStandaloneHost)
                {
                    _poolIconHostCheckCell = new DataGridViewIconCell();
                }
                else
                {
                    _poolIconHostCheckCell = new DataGridViewCheckBoxCell();
                }

                _nameCell    = new DataGridViewNameCell();
                _versionCell = new DataGridViewTextBoxCell();

                Cells.AddRange(_expansionCell, _poolCheckBoxCell, _poolIconHostCheckCell, _nameCell, _versionCell);

                this.UpdateDetails();
            }
Ejemplo n.º 25
0
            public SrRow(SR.SRInfo srInfo, SR.SRTypes type, bool poolMetadataDetected, bool selected)
            {
                SrInfo = srInfo;

                var cellTick = new DataGridViewCheckBoxCell {
                    Value = selected
                };
                var cellName = new DataGridViewTextBoxCell {
                    Value = srInfo.Name
                };
                var cellDesc = new DataGridViewTextBoxCell {
                    Value = srInfo.Description
                };
                var cellType = new DataGridViewTextBoxCell {
                    Value = SR.getFriendlyTypeName(type)
                };
                var cellMetadata = new DataGridViewTextBoxCell {
                    Value = poolMetadataDetected.ToStringI18n()
                };

                Cells.AddRange(cellTick, cellName, cellDesc, cellType, cellMetadata);
            }
            private void SetupCells()
            {
                _poolCheckBoxCell = new DataGridViewCheckBoxCell {
                    ThreeState = true
                };

                _expansionCell = new DataGridViewImageCell();

                if (Tag is Pool || (Tag is Host && !_hasPool))
                {
                    _poolIconHostCheckCell = new DataGridViewIconCell();
                }
                else
                {
                    _poolIconHostCheckCell = new DataGridViewCheckBoxCell();
                }

                _nameCell    = new DataGridViewNameCell();
                _versionCell = new DataGridViewTextBoxCell();

                Cells.AddRange(new[] { _expansionCell, _poolCheckBoxCell, _poolIconHostCheckCell, _nameCell, _versionCell });

                this.UpdateDetails();
            }
Ejemplo n.º 27
0
        protected void ConstructCells()
        {
            var tbVDI = new DataGridViewTextBoxCell {
                Value = VdiColumnText
            };
            var tbSR = new DataGridViewTextBoxCell {
                Value = SrColumnText
            };
            var cbLUN = new DataGridViewEnableableComboBoxCell {
                FlatStyle = FlatStyle.Flat
            };

            foreach (VDI vdi in Sr.Connection.ResolveAll(Sr.VDIs))
            {
                cbLUN.Items.Add(new LunComboBoxItem(vdi)
                {
                    AdditionalConstraints = LunConstraints
                });
            }

            cbLUN.Items.OfType <LunComboBoxItem>().OrderBy(i => i.Enabled);
            Cells.AddRange(tbVDI, cbLUN, tbSR);
            Debug.Assert(cbLUN.Items.Count == Sr.VDIs.Count, "Not all combobox items were converted");
        }
Ejemplo n.º 28
0
            public NetworkRow(XenAPI.Network network, IXenObject xmo)
            {
                Network = network;
                Xmo     = xmo;

                Cells.AddRange(ImageCell,
                               NameCell,
                               DescriptionCell,
                               NicCell,
                               VlanCell,
                               AutoCell,
                               LinkStatusCell,
                               MacCell);

                // add MTU to grid view on Network tab for pools and hosts, for Cowley or greater only (CA-45643)
                if (Helpers.CowleyOrGreater(Xmo.Connection))
                {
                    Cells.Add(this.MtuCell);
                }

                Network.PropertyChanged += Server_PropertyChanged;

                Program.Invoke(Program.MainWindow, UpdateDetails);
            }
Ejemplo n.º 29
0
            public TemplatesGridViewItem(VM template)
            {
                Template = template;

                SortOrder = (int)template.TemplateType;
                if (template.IsHidden)
                {
                    SortOrder += (int)VM.VmTemplateType.Count;
                }

                var ImageCell = new DataGridViewImageCell(false)
                {
                    ValueType = typeof(Image),
                    Value     = template.TemplateType.ToBitmap()
                };
                var TypeCell = new DataGridViewTextBoxCell {
                    Value = template.TemplateType.ToDisplayString()
                };
                var NameCell = new DataGridViewTextBoxCell {
                    Value = template.Name
                };

                Cells.AddRange(ImageCell, NameCell, TypeCell);
            }
 protected PreCheckGridRow(DataGridViewCell solutionCell)
 {
     _solutionCell = solutionCell;
     Cells.AddRange(_iconCell, _descriptionCell, _solutionCell);
 }