コード例 #1
0
        /// <summary>
        ///     Checks if the specified resource record exists
        /// </summary>
        /// <param name="name">The resource record.</param>
        /// <returns><c>true</c> if found; otherwise <c>false</c>;</returns>
        public bool Exists(ResourceRecord record)
        {
            if (record == null) throw new ArgumentNullException("item");

            string key = string.Concat(record.Domain, "|", record.Type.ToString(), "|", record.Class);
            return _items.Contains(key);
        }
コード例 #2
0
        /// <summary>
        ///     Add a resource record.
        /// </summary>
        public void Add(ResourceRecord record)
        {
            if (record == null) throw new ArgumentNullException("record");

            string key = string.Concat(record.Domain, "|", record.Type.ToString(), "|", record.Class);
            _items.Add(key, record);
        }
コード例 #3
0
 /// <summary>
 ///     Get a resource record.
 /// </summary>
 /// <param name="record"></param>
 /// <returns></returns>
 public ResourceRecord Get(ResourceRecord record)
 {
     string key = string.Concat(record.Domain, "|", record.Type.ToString(), "|", record.Class);
     if (_items.Contains(key))
     {
         return (ResourceRecord)_items[key];
     }
     return null;
 }