Castle.MonoRail.Framework.Flash.Add C# (CSharp) Method

Add() public method

Adds an element with the specified key and value into the .
The is read-only.-or- The has a fixed size. An element with the same key already exists in the . key is null.
public Add ( object key, object value ) : void
key object The key of the element to add.
value object The value of the element to add. The value can be null.
return void
		public override void Add(object key, object value)
		{
			InternalAdd(key, value);
		}

Usage Example

Example #1
0
		public void FlashDiscard()
		{
			Flash flash = new Flash();

			flash.Add("test1","hello");
			flash.Add("test2","hello");

			flash.Discard("test2");

			flash.Sweep();

			Assert.IsTrue( flash.ContainsKey("test1") );
			Assert.IsFalse( flash.ContainsKey("test2") );

			flash = new Flash(flash);
			flash.Sweep();

			Assert.IsTrue( flash.Count == 0 );

			flash.Add("test1","hello");
			flash.Add("test2","hello");

			flash.Discard();

			flash = new Flash(flash);
			flash.Sweep();

			Assert.IsFalse( flash.ContainsKey("test1") );
			Assert.IsFalse( flash.ContainsKey("test2") );
		}
All Usage Examples Of Castle.MonoRail.Framework.Flash::Add