Ejemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            ApplyLicenseEditionCommand command = new ApplyLicenseEditionCommand(Program.MainWindow, xos, GetCheckedEdition(), licenseServerNameTextBox.Text, licenseServerPortTextBox.Text, this);

            command.Succedded += delegate
            {
                Program.Invoke(this, () =>
                {
                    DialogResult = DialogResult.OK;
                    Close();
                });
            };
            command.Execute();
        }
Ejemplo n.º 2
0
        public void ReleaseLicenses(List <CheckableDataGridViewRow> rowsChecked)
        {
            Debug.Assert(rowsChecked.Count > 0, "There must be one license selected to perform this operation");
            List <LicenseDataGridViewRow> rowsUsingLicenseServer = rowsChecked.ConvertAll(r => r as LicenseDataGridViewRow).Where(
                r => r.XenObject.Connection.IsConnected && r.HasLicenseServer).ToList();

            if (rowsUsingLicenseServer.Count > 0)
            {
                ApplyLicenseEditionCommand command = new ApplyLicenseEditionCommand(CommandInterface,
                                                                                    rowsUsingLicenseServer.ConvertAll(r => r.XenObject),
                                                                                    Host.Edition.Free, null, null,
                                                                                    View.Parent);
                command.Execute();
            }
            else
            {
                ShowPoolHostNotConnectedError();
            }

            SummariseDisconnectedRows(rowsChecked);
            ResetButtonEnablement();
        }