当前位置: 首页>>代码示例>>C#>>正文


C# EventInfo.IsDefined方法代码示例

本文整理汇总了C#中System.Reflection.EventInfo.IsDefined方法的典型用法代码示例。如果您正苦于以下问题:C# EventInfo.IsDefined方法的具体用法?C# EventInfo.IsDefined怎么用?C# EventInfo.IsDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.EventInfo的用法示例。


在下文中一共展示了EventInfo.IsDefined方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEventOptions

        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;
        }
开发者ID:Nementon,项目名称:ck-desktop,代码行数:17,代码来源:DefaultProxyDefinition.cs

示例2: InternalIsDefined

        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;
        }
开发者ID:Clockwork-Muse,项目名称:coreclr,代码行数:27,代码来源:Attribute.cs

示例3: InternalIsDefined

 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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:Attribute.cs

示例4: InternalIsDefined

		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;
		}
开发者ID:ChristianWulf,项目名称:CSharpKDMDiscoverer,代码行数:25,代码来源:Attribute.cs

示例5: AcceptEvent

 /// <inheritdoc/>
 public bool AcceptEvent(EventInfo eventInfo)
 {
     return !eventInfo.IsDefined(typeof (NonInterceptedAttribute), false);
 }
开发者ID:mtamme,项目名称:NProxy,代码行数:5,代码来源:NonInterceptedInterceptionFilter.cs

示例6: InternalIsDefined

 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;
 }
开发者ID:consumentor,项目名称:Server,代码行数:14,代码来源:Attribute.cs


注:本文中的System.Reflection.EventInfo.IsDefined方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。