private void btnAdd_Click(object sender, EventArgs e)
        {
            EditProxyDeployForm form = new EditProxyDeployForm();
            form.Completed += delegate(object s, EventArgs arg)
            {
                XmlElement siteElement = form.GetResultXml();
                AddSiteRow(siteElement);
                SavePreference();
            };

            form.ShowDialog();
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            EditProxyDeployForm form = new EditProxyDeployForm();

            form.Completed += delegate(object s, EventArgs arg)
            {
                XmlElement siteElement = form.GetResultXml();
                AddSiteRow(siteElement);
                SavePreference();
            };

            form.ShowDialog();
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgSites.SelectedRows.Count == 0) return;

            DataGridViewRow row = dgSites.SelectedRows[0];
            XmlElement siteElement = row.Tag as XmlElement;

            EditProxyDeployForm form = new EditProxyDeployForm(siteElement);
            form.Completed += delegate(object s, EventArgs arg)
            {
                XmlElement result = form.GetResultXml();
                BindSiteToRow(row, result);
                SavePreference();
            };

            form.ShowDialog();
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgSites.SelectedRows.Count == 0)
            {
                return;
            }

            DataGridViewRow row         = dgSites.SelectedRows[0];
            XmlElement      siteElement = row.Tag as XmlElement;

            EditProxyDeployForm form = new EditProxyDeployForm(siteElement);

            form.Completed += delegate(object s, EventArgs arg)
            {
                XmlElement result = form.GetResultXml();
                BindSiteToRow(row, result);
                SavePreference();
            };

            form.ShowDialog();
        }