コード例 #1
0
        /// <summary>
        /// Removes a cache host element from the collection.
        /// </summary>
        /// <param name="item">The cache host element.</param>
        /// <returns>true if the cache host element was removed, false otherwise.</returns>
        public bool Remove(CacheHostElement item)
        {
            if (BaseIndexOf(item) >= 0)
            {
                BaseRemove(item);
                return(true);
            }

            return(false);
        }
コード例 #2
0
 /// <summary>
 /// Adds a cache host element to the collection.
 /// </summary>
 /// <param name="item">The cache host element.</param>
 public void Add(CacheHostElement item)
 {
     BaseAdd(item);
 }
コード例 #3
0
 /// <summary>
 /// Returns the index of the cache host element.
 /// </summary>
 /// <param name="service">The cache host element.</param>
 /// <returns>The index.</returns>
 public int IndexOf(CacheHostElement service)
 {
     return(BaseIndexOf(service));
 }
コード例 #4
0
        /// <summary>
        /// Gets the key of a given configuration element.
        /// </summary>
        /// <param name="element">The configuration element.</param>
        /// <returns>The key.</returns>
        protected override object GetElementKey(ConfigurationElement element)
        {
            CacheHostElement service = (CacheHostElement)element;

            return(service.Address + ":" + service.Port);
        }
コード例 #5
0
 /// <summary>
 /// Determines whether or not the collection contains the specified cache host element.
 /// </summary>
 /// <param name="item">The cache host element.</param>
 /// <returns>true if the collection contains the element, false otherwise.</returns>
 public bool Contains(CacheHostElement item)
 {
     return(BaseIndexOf(item) >= 0);
 }