コード例 #1
0
        public static DnsResourceRecordInfo GetRecordInfo(this DnsResourceRecord record)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            return(rrInfo);
        }
コード例 #2
0
        public static void SetGlueRecords(this DnsResourceRecord record, IReadOnlyList <DnsResourceRecord> glueRecords)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.GlueRecords = glueRecords;
        }
コード例 #3
0
        public static void SetDeletedOn(this DnsResourceRecord record, DateTime value)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.DeletedOn = value;
        }
コード例 #4
0
        public static void SetPrimaryNameServers(this DnsResourceRecord record, IReadOnlyList <NameServerAddress> primaryNameServers)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.PrimaryNameServers = primaryNameServers;
        }
コード例 #5
0
        public static void Disable(this DnsResourceRecord record)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.Disabled = true;
        }
コード例 #6
0
        public static void SetComments(this DnsResourceRecord record, string value)
        {
            if (record.Tag is not DnsResourceRecordInfo rrInfo)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.Comments = value;
        }
コード例 #7
0
        public static void Enable(this DnsResourceRecord record)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo == null)
            {
                return;
            }

            rrInfo.Disabled = false;
        }
コード例 #8
0
        public static bool IsDisabled(this DnsResourceRecord record)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo == null)
            {
                return(false);
            }

            return(rrInfo.Disabled);
        }
コード例 #9
0
        public static string GetComments(this DnsResourceRecord record)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo is null)
            {
                return(null);
            }

            return(rrInfo.Comments);
        }
コード例 #10
0
        public static void SetGlueRecords(this DnsResourceRecord record, IReadOnlyList <DnsResourceRecord> glueRecords)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo == null)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.GlueRecords = glueRecords;
        }
コード例 #11
0
        public static void Disable(this DnsResourceRecord record)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo == null)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.Disabled = true;
        }
コード例 #12
0
        public static void SetComments(this DnsResourceRecord record, string value)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo is null)
            {
                rrInfo     = new DnsResourceRecordInfo();
                record.Tag = rrInfo;
            }

            rrInfo.Comments = value;
        }
コード例 #13
0
        public static IReadOnlyList <DnsResourceRecord> GetGlueRecords(this DnsResourceRecord record)
        {
            DnsResourceRecordInfo rrInfo = record.Tag as DnsResourceRecordInfo;

            if (rrInfo == null)
            {
                return(Array.Empty <DnsResourceRecord>());
            }

            IReadOnlyList <DnsResourceRecord> glueRecords = rrInfo.GlueRecords;

            if (glueRecords == null)
            {
                return(Array.Empty <DnsResourceRecord>());
            }

            return(glueRecords);
        }