Castle.MonoRail.Framework.Flash.Keep C# (CSharp) Méthode

Keep() public méthode

Keeps the entire flash contents available for the next action
public Keep ( ) : void
Résultat void
		public void Keep()
		{
			keep.Clear();

			foreach(object key in base.Keys)
			{
				keep.Add(key);
			}
		}

Same methods

Flash::Keep ( object key ) : void

Usage Example

Exemple #1
0
		public void FlashKeep()
		{
			Flash flash = new Flash();

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

			flash.Keep("test1");

			flash.Sweep();

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

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

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

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

			flash.Keep();

			flash.Sweep();

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