Castle.MicroKernel.Context.CreationContext.SetContextualProperty C# (CSharp) Method

SetContextualProperty() public method

public SetContextualProperty ( object key, object value ) : void
key object
value object
return void
		public void SetContextualProperty(object key, object value)
		{
			if (key == null)
			{
				throw new ArgumentNullException("key");
			}
			if (extendedProperties == null)
			{
				extendedProperties = new Arguments();
			}
			extendedProperties[key] = value;
		}

Usage Example

		protected override object InternalCreate(CreationContext context)
		{
			var instance = Instantiate(context);
			context.SetContextualProperty(this, instance);

			SetUpProperties(instance, context);

			ApplyCommissionConcerns(instance);

			return instance;
		}