2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
11 public partial class GlobalZonesInputBox : Form
13 private ListView.ListViewItemCollection globalZonesItems;
15 public GlobalZonesInputBox(ListView.ListViewItemCollection globalZonesItems)
17 InitializeComponent();
19 this.globalZonesItems = globalZonesItems;
22 private void Warning(string message)
24 MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
28 private void btnOK_Click(object sender, EventArgs e)
30 if (txtGlobalZoneName.Text == "global-templates" || txtGlobalZoneName.Text == "director-global") {
31 Warning("This global zone is configured by default.");
35 foreach (ListViewItem lvw in globalZonesItems) {
36 if (txtGlobalZoneName.Text == lvw.Text) {
37 Warning("This global zone is already defined.");
42 DialogResult = DialogResult.OK;