Castle.MicroKernel.Burden.Release C# (CSharp) Method

Release() public method

public Release ( ) : bool
return bool
		public bool Release()
		{
			var releasing = Releasing;
			if (releasing != null)
			{
				releasing(this);
			}

			if (handler.Release(this) == false)
			{
				return false;
			}

			var released = Released;
			if (released != null)
			{
				released(this);
			}

			if (dependencies != null)
			{
				dependencies.ForEach(c => c.Release());
			}
			var graphReleased = GraphReleased;
			if (graphReleased != null)
			{
				graphReleased(this);
			}
			return true;
		}

Usage Example

		private void Evict(Burden instance)
		{
			using (new EvictionScope(this))
				instance.Release();
		}