public ProxyOptions GetEventOptions( EventInfo e ) { ProxyOptions opt = new ProxyOptions(); opt.CatchExceptions = _errorCatch == CatchExceptionGeneration.Always || (_errorCatch == CatchExceptionGeneration.HonorIgnoreExceptionAttribute && !e.IsDefined( typeof( IgnoreExceptionAttribute ), false )); if( _isDynamicService ) { bool stopAllowed = e.IsDefined( typeof( IgnoreServiceStoppedAttribute ), false ); opt.RuntimeCheckStatus = stopAllowed ? ProxyOptions.CheckStatus.NotDisabled : ProxyOptions.CheckStatus.Running; } else opt.RuntimeCheckStatus = ProxyOptions.CheckStatus.None; return opt; }
public override bool IsDefined(Type attributeType, bool inherit) { return(_innerEventInfo.IsDefined(attributeType, inherit)); }
private static bool InternalIsDefined (EventInfo element, Type attributeType, bool inherit) { Contract.Requires(element != null); // walk up the hierarchy chain if (element.IsDefined(attributeType, inherit)) return true; if (inherit) { AttributeUsageAttribute usage = InternalGetAttributeUsage(attributeType); if (!usage.Inherited) return false; EventInfo baseEvent = GetParentDefinition(element); while (baseEvent != null) { if (baseEvent.IsDefined(attributeType, false)) return true; baseEvent = GetParentDefinition(baseEvent); } } return false; }
private static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit) { if (element.IsDefined(attributeType, inherit)) { return true; } if (inherit) { if (!InternalGetAttributeUsage(attributeType).Inherited) { return false; } for (EventInfo info = GetParentDefinition(element); info != null; info = GetParentDefinition(info)) { if (info.IsDefined(attributeType, false)) { return true; } } } return false; }
private static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit) { if (element.IsDefined(attributeType, inherit)) { return true; } if (inherit) { AttributeUsageAttribute attributeUsageAttribute = Attribute.InternalGetAttributeUsage(attributeType); if (!attributeUsageAttribute.Inherited) { return false; } EventInfo parentDefinition = Attribute.GetParentDefinition(element); while (parentDefinition != null) { if (parentDefinition.IsDefined(attributeType, false)) { return true; } parentDefinition = Attribute.GetParentDefinition(parentDefinition); } } return false; }
/// <inheritdoc/> public bool AcceptEvent(EventInfo eventInfo) { return !eventInfo.IsDefined(typeof (NonInterceptedAttribute), false); }
private static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit) { if (element.IsDefined(attributeType, inherit)) return true; if (inherit && Attribute.InternalGetAttributeUsage(attributeType).Inherited) { for (EventInfo parentDefinition = Attribute.GetParentDefinition(element); parentDefinition != null; parentDefinition = Attribute.GetParentDefinition(parentDefinition)) { if (parentDefinition.IsDefined(attributeType, false)) return true; } } return false; }