示例#1
0
 public void Remove(string key)
 {
     if (_dictionary != null)
     {
         _dictionary.Remove(key);
     }
 }
        /// <summary>
        /// Remove a property
        /// </summary>
        /// <param name="key">the key for the entry to remove</param>
        /// <remarks>
        /// <para>
        /// Remove the value for the specified <paramref name="key"/> from the context.
        /// </para>
        /// </remarks>
        public void Remove(string key)
        {
            PropertiesDictionary dictionary = GetProperties(false);

            if (dictionary != null)
            {
                dictionary.Remove(key);
            }
        }
        /// <summary>
        /// Remove a property
        /// </summary>
        /// <param name="key">the key for the entry to remove</param>
        /// <remarks>
        /// <para>
        /// Remove a property
        /// </para>
        /// </remarks>
        public void Remove(string key)
        {
#if NETCF
            PropertiesDictionary _dictionary = GetProperties(false);
#endif
            if (_dictionary != null)
            {
                _dictionary.Remove(key);
            }
        }
示例#4
0
        /// <summary>
        /// Remove a property
        /// </summary>
        /// <param name="key">the key for the entry to remove</param>
        /// <remarks>
        /// <para>
        /// Remove the value for the specified <paramref name="key"/> from the context.
        /// </para>
        /// </remarks>
        public void Remove(string key)
        {
            PropertiesDictionary dictionary = GetProperties(false);

            if (dictionary != null)
            {
                PropertiesDictionary immutableProps = new PropertiesDictionary(dictionary);
                immutableProps.Remove(key);
                SetLogicalProperties(immutableProps);
            }
        }
示例#5
0
 /// <summary>
 /// Remove a property from the global context
 /// </summary>
 /// <param name="key">the key for the entry to remove</param>
 /// <remarks>
 /// <para>
 /// Removing an entry from the global context properties is relatively expensive compared
 /// with reading a value.
 /// </para>
 /// </remarks>
 public void Remove(string key)
 {
     lock (m_syncRoot)
     {
         if (m_readOnlyProperties.Contains(key))
         {
             PropertiesDictionary propertiesDictionary = new PropertiesDictionary(m_readOnlyProperties);
             propertiesDictionary.Remove(key);
             m_readOnlyProperties = new ReadOnlyPropertiesDictionary(propertiesDictionary);
         }
     }
 }
        /// <summary>
        /// Remove a property from the global context
        /// </summary>
        /// <param name="key">the key for the entry to remove</param>
        /// <remarks>
        /// <para>
        /// Removing an entry from the global context properties is relatively expensive compared
        /// with reading a value.
        /// </para>
        /// </remarks>
        public void Remove(string key)
        {
            lock (m_syncRoot) {
                if (m_readOnlyProperties.Contains(key))
                {
                    var mutableProps = new PropertiesDictionary(m_readOnlyProperties);

                    mutableProps.Remove(key);

                    m_readOnlyProperties = new ReadOnlyPropertiesDictionary(mutableProps);
                }
            }
        }