Esempio n. 1
0
        public override void SetUIFieldsFromRecordData(VmDnsRecord record)

        {
            VmDnsRecordSRV srvRecord = record as VmDnsRecordSRV;

            if (srvRecord != null)

            {
                AddRecordFrm.SRVRecordTargetHostText.Text = srvRecord.Target;

                AddRecordFrm.SRVRecordPriorityText.Text = srvRecord.Priority.ToString();

                AddRecordFrm.SRVRecordWeightText.Text = srvRecord.Weight.ToString();

                AddRecordFrm.SRVPortText.Text = srvRecord.Port.ToString();

                AddRecordFrm.SRVRecordProtocolNameText.Visible = true;

                AddRecordFrm.SRVRecordProtocolNameText.Text = srvRecord.Name;

                AddRecordFrm.SRVRecordProtocolLabel.Visible = true;

                AddRecordFrm.SRVRecordProtocolCombo.Visible = false;

                AddRecordFrm.SRVRecordServiceCombo.Visible = false;

                AddRecordFrm.SRVRecordServiceLabel.Visible = false;
            }

            else
            {
                UIErrorHelper.ShowMessage("Unknown Record Format");
            }
        }
Esempio n. 2
0
        public override VmDnsRecord GetRecordDataFromUIFields()

        {
            VmDnsRecord addressRecord = null;

            UIErrorHelper.CheckedExec(delegate()

            {
                DoValidateControls();

                var data = new VMDNS_SRV_DATA();

                data.pNameTarget = AddRecordFrm.SRVRecordTargetHostText.Text;

                data.wPriority = Convert.ToUInt16(AddRecordFrm.SRVRecordPriorityText.Text);

                data.wWeight = Convert.ToUInt16(AddRecordFrm.SRVRecordWeightText.Text);

                data.wPort = Convert.ToUInt16(AddRecordFrm.SRVPortText.Text);

                var record = new VMDNS_RECORD_SRV();

                record.data = data;

                record.common.iClass = 1;

                record.common.pszName = "_" + AddRecordFrm.SRVRecordServiceCombo.Text + "._" + AddRecordFrm.SRVRecordProtocolCombo.Text;

                record.common.type = (UInt16)RecordType.VMDNS_RR_TYPE_SRV;

                addressRecord = new VmDnsRecordSRV(record);
            });

            return(addressRecord);
        }
Esempio n. 3
0
        public override VmDnsRecord GetRecordDataFromUIFields()
        {
            VmDnsRecord addressRecord = null;

            UIErrorHelper.CheckedExec(delegate()
            {
                DoValidateControls();
                var data              = new VMDNS_SRV_DATA();
                data.pNameTarget      = TargetHostField.StringValue;
                data.wPriority        = Convert.ToUInt16(PriorityField.StringValue);
                data.wWeight          = Convert.ToUInt16(WeightField.StringValue);
                data.wPort            = Convert.ToUInt16(PortField.StringValue);
                var record            = new VMDNS_RECORD_SRV();
                record.data           = data;
                record.common.iClass  = 1;
                record.common.pszName = "_" + ServiceOptionsField.TitleOfSelectedItem + "._" + ProtocolOptionsField.TitleOfSelectedItem;
                record.common.type    = (UInt16)RecordType.VMDNS_RR_TYPE_SRV;
                addressRecord         = new VmDnsRecordSRV(record);
            });
            return(addressRecord);
        }
Esempio n. 4
0
        public override void SetUIFieldsFromRecordData(VmDnsRecord record)
        {
            VmDnsRecordSRV srvRecord = record as VmDnsRecordSRV;

            if (srvRecord != null)
            {
                TargetHostField.StringValue = srvRecord.Target;
                PriorityField.StringValue   = srvRecord.Priority.ToString();
                WeightField.StringValue     = srvRecord.Weight.ToString();
                PortField.StringValue       = srvRecord.Port.ToString();
                RecordNameField.StringValue = srvRecord.Name;
                ServiceOptionsField.Hidden  = true;
                ServiceOptionsLabel.Hidden  = true;
                ProtocolOptionsField.Hidden = true;
                ProtocolLabel.Hidden        = true;
                RecordNameField.Hidden      = false;
                RecordNameLabel.Hidden      = false;
            }
            else
            {
                UIErrorHelper.ShowAlert("", "Unknown Record Format");
            }
        }