Esempio n. 1
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewRecrods.SelectedItems.Count == 1)
     {
         Amazon.Route53.Model.ResourceRecordSet set = (Amazon.Route53.Model.ResourceRecordSet)listViewRecrods.SelectedItems[0].Tag;
         DlgEditDnsRecord dlg = new DlgEditDnsRecord(MyController, set);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             Amazon.Route53.Model.ChangeResourceRecordSetsResponse resp =
                 MyController.route53.ChangeResourceRecordSets(new Amazon.Route53.Model.ChangeResourceRecordSetsRequest()
                                                               .WithHostedZoneId(this.MyZone.ResponseData.Id)
                                                               .WithChangeBatch(new Amazon.Route53.Model.ChangeBatch()
                                                                                .WithChanges(new Amazon.Route53.Model.Change()
                                                                                             .WithAction("DELETE")
                                                                                             .WithResourceRecordSet(set),
                                                                                             new Amazon.Route53.Model.Change()
                                                                                             .WithAction("CREATE")
                                                                                             .WithResourceRecordSet(new Amazon.Route53.Model.ResourceRecordSet()
                                                                                                                    .WithName(dlg.textBoxName.Text)
                                                                                                                    .WithType(dlg.comboBoxRecordType.Text)
                                                                                                                    .WithTTL(Convert.ToInt32(dlg.textBoxTTL.Text))
                                                                                                                    .WithResourceRecords(dlg.CurrentResourceRecords)))));
             Thread.Sleep(2000);
             MyZone.UpdateInfo();
             ShowItems();
         }
     }
 }
Esempio n. 2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Amazon.Route53.Model.ResourceRecordSet set = new Amazon.Route53.Model.ResourceRecordSet();
            DlgEditDnsRecord dlg = new DlgEditDnsRecord(MyController, set);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                MyZone.AddRecord(new Amazon.Route53.Model.ResourceRecordSet()
                                 .WithName(dlg.textBoxName.Text)
                                 .WithType(dlg.comboBoxRecordType.Text)
                                 .WithTTL(Convert.ToInt32(dlg.textBoxTTL.Text))
                                 .WithResourceRecords(dlg.CurrentResourceRecords));
                ShowItems();
            }
        }
Esempio n. 3
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     Amazon.Route53.Model.ResourceRecordSet set = new Amazon.Route53.Model.ResourceRecordSet();
     DlgEditDnsRecord dlg = new DlgEditDnsRecord(MyController, set);
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         MyZone.AddRecord(new Amazon.Route53.Model.ResourceRecordSet()
                                             .WithName(dlg.textBoxName.Text)
                                             .WithType(dlg.comboBoxRecordType.Text)
                                             .WithTTL(Convert.ToInt32(dlg.textBoxTTL.Text))
                                             .WithResourceRecords(dlg.CurrentResourceRecords));
         ShowItems();
     }
 }
Esempio n. 4
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewRecrods.SelectedItems.Count == 1)
     {
         Amazon.Route53.Model.ResourceRecordSet set = (Amazon.Route53.Model.ResourceRecordSet)listViewRecrods.SelectedItems[0].Tag;
         DlgEditDnsRecord dlg = new DlgEditDnsRecord(MyController, set);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             Amazon.Route53.Model.ChangeResourceRecordSetsResponse resp =
             MyController.route53.ChangeResourceRecordSets(new Amazon.Route53.Model.ChangeResourceRecordSetsRequest()
                 .WithHostedZoneId(this.MyZone.ResponseData.Id)
                 .WithChangeBatch(new Amazon.Route53.Model.ChangeBatch()
                         .WithChanges(new Amazon.Route53.Model.Change()
                                            .WithAction("DELETE")
                                            .WithResourceRecordSet(set),
                                      new Amazon.Route53.Model.Change()
                                            .WithAction("CREATE")
                                            .WithResourceRecordSet(new Amazon.Route53.Model.ResourceRecordSet()
                                               .WithName(dlg.textBoxName.Text)
                                               .WithType(dlg.comboBoxRecordType.Text)
                                               .WithTTL(Convert.ToInt32(dlg.textBoxTTL.Text))
                                               .WithResourceRecords(dlg.CurrentResourceRecords)))));
             Thread.Sleep(2000);
             MyZone.UpdateInfo();
             ShowItems();
         }
     }
 }