public override bool IsContextOK(Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage ctorMsg) { var p = ctx.GetProperty("Reporting") as ReportingProperty; if (p == null) { return(false); } return(true); }
public override void GetPropertiesForNewContext(System.Runtime.Remoting.Activation.IConstructionCallMessage ctorMsg) { base.GetPropertiesForNewContext(ctorMsg); ctorMsg.ContextProperties.Add(new AdvisableContextProperty(this, ctorMsg.ActivationType)); }
/// <summary> /// Returns a Boolean value indicating whether the context parameter meets the context attribute's requirements. /// </summary> /// <param name="ctx">The context in which to check.</param> /// <param name="ctorMsg">The <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage" /> to which to add the context property.</param> /// <returns> /// true if the passed in context is okay; otherwise, false. /// </returns> /// <PermissionSet> /// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" /> /// </PermissionSet> public override bool IsContextOK(Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage ctorMsg) { return(ctx.GetProperty(Consts.ContextName) as ContextProperty != null); }