Indicates that a property is the context property.

Namespace: Xafari
Assembly: Xafari (in Xafari.dll)

Syntax

C#

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ContextPropertyAttribute : Attribute

 

Remarks

Apply this attribute to a property which will be used as the context of the some predefined action. This action will be only applied to the objects which satisfy specified context match mode. Default mode is exact match the object type to the context property type. Posible context match modes are defined by ContextTypeMatchMode enumeration.

 

 
 public class CalcOrderTotal
 {
   [ContextProperty]
   public Order Order { get; set; }
   ...
 }
 

The context property may be of a generic collection type. In this case action may be applied to list of objects.

 

 
 public class CalcOrderTotalList
 {
    [ContextProperty]
    public IEnumerable<Order> Orders { get; set; }
    ...
 }
 

Inheritance Hierarchy

System.Object

System.Attribute

Xafari.ContextPropertyAttribute

See Also