System.Configuration.SettingsPropertyCollection.Remove C# (CSharp) Метод

Remove() публичный Метод

public Remove ( string name ) : void
name string
Результат void
       public void Remove(string name)
       {
           if (_ReadOnly)
               throw new NotSupportedException();
           SettingsProperty toRemove = (SettingsProperty)_Hashtable[name];
           if (toRemove == null)
               return;
           OnRemove(toRemove);
           _Hashtable.Remove(name);
           try {
               OnRemoveComplete(toRemove);
           }
           catch {
               _Hashtable.Add(name, toRemove);
               throw;
           }

       }

Usage Example

		public void Remove ()
		{
			SettingsPropertyCollection col = new SettingsPropertyCollection ();
			SettingsProperty test_prop = new SettingsProperty ("test_prop");

			col.Add (test_prop);

			Assert.AreEqual (1, col.Count, "A1");

			col.Remove ("test_prop");

			Assert.AreEqual (0, col.Count, "A2");
		}
All Usage Examples Of System.Configuration.SettingsPropertyCollection::Remove