コード例 #1
0
        /// <summary>
        /// Add element into the collection.
        /// </summary>
        /// <param name="capability">The capability to be added to the whitelist.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public void Add(CapabilityElement capability)
        {
            if (capability == null)
                throw new ArgumentNullException("capability");

            BaseAdd(capability);
        }
コード例 #2
0
        /// <summary>
        /// Add element into the collection.
        /// </summary>
        /// <param name="capability">The capability to be added to the whitelist.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public void Add(CapabilityElement capability)
        {
            if (capability == null)
            {
                throw new ArgumentNullException("capability");
            }

            BaseAdd(capability);
        }
コード例 #3
0
        /// <summary>
        /// Gets the index of the specific element inside the collection.
        /// </summary>
        /// <param name="capability">The capability whos index is being sought.</param>
        /// <returns>The index of the capability requested.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public int IndexOf(CapabilityElement capability)
        {
            if (capability == null)
            {
                throw new ArgumentNullException("capability");
            }

            return(BaseIndexOf(capability));
        }
コード例 #4
0
        /// <summary>
        /// Removes a <see cref="System.Configuration.ConfigurationElement"/> from the collection.
        /// </summary>
        /// <param name="capability">The capability to be removed from the whitelist.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public void Remove(CapabilityElement capability)
        {
            if (capability == null)
            {
                throw new ArgumentNullException("capability");
            }

            if (BaseIndexOf(capability) >= 0)
            {
                BaseRemove(capability.CapabilityName);
            }
        }
コード例 #5
0
        /// <summary>
        /// Gets the index of the specific element inside the collection.
        /// </summary>
        /// <param name="capability">The capability whos index is being sought.</param>
        /// <returns>The index of the capability requested.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public int IndexOf(CapabilityElement capability)
        {
            if (capability == null)
                throw new ArgumentNullException("capability");

            return BaseIndexOf(capability);
        }
コード例 #6
0
        /// <summary>
        /// Removes a <see cref="System.Configuration.ConfigurationElement"/> from the collection.
        /// </summary>
        /// <param name="capability">The capability to be removed from the whitelist.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="capability"/> equals null.</exception>
        public void Remove(CapabilityElement capability)
        {
            if (capability == null)
                throw new ArgumentNullException("capability");

            if (BaseIndexOf(capability) >= 0)
                BaseRemove(capability.CapabilityName);
        }