All we need now is an attribute that adds the Trace MessageSink Property to the constructor call messages context properties in the Get PropertiesFor NewContext method

[AttributeUsage(AttributeTargets.Class)]

public class TraceMessageSinkAttribute : ContextAttribute {

public TraceMessageSinkAttribute() : base("TraceMessageSinkAttribute")

public override void GetPropertiesForNewContext( IConstructionCallMessage msg )

msg.ContextProperties.Add(

new TraceMessageSinkProperty(this.AttributeName));

public override System.Boolean IsContextOK (

Context ctx , IConstructionCallMessage msg )

return (ctx.GetProperty(this.AttributeName) != null);

0 0

Post a comment