AzureDNSManager.AzureDNSViewModel.AddZone C# (CSharp) Method

AddZone() protected method

protected AddZone ( ) : void
return void
        protected async void AddZone()
        {
            InputDialog input = new InputDialog("Enter zone name", "Enter the name of the DNS zone to add", "");
            if (ActiveResourceGroup != null && input.ShowDialog() == true)
            {
                ZoneCreateOrUpdateParameters p = new ZoneCreateOrUpdateParameters();
                p.Zone = new Zone("global");
                p.Zone.Properties = new ZoneProperties();
                try
                {
                    ZoneCreateOrUpdateResponse responseCreateZone = await _dnsManagementClient.Zones.CreateOrUpdateAsync(ActiveResourceGroup.Name, input.Value, p, null, null);
                    ReloadZones();
                } catch(Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                    MessageBox.Show("Failed to add zone name!");
                }
            }
        }