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


C# TypeDefinition.GetCustomAttributes方法代码示例

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


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

示例1: FromTypeDefinition

 public static BroadcastReceiverAttribute FromTypeDefinition(TypeDefinition type)
 {
     CustomAttribute attr = type.GetCustomAttributes ("Android.Content.BroadcastReceiverAttribute")
         .SingleOrDefault ();
     if (attr == null)
         return null;
     var self = new BroadcastReceiverAttribute ();
     self.specified = mapping.Load (self, attr);
     return self;
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:10,代码来源:BroadcastReceiverAttribute.Partial.cs

示例2: FromTypeDefinition

 public static ServiceAttribute FromTypeDefinition(TypeDefinition type)
 {
     CustomAttribute attr = type.GetCustomAttributes ("Android.App.ServiceAttribute")
         .SingleOrDefault ();
     if (attr == null)
         return null;
     ServiceAttribute self = new ServiceAttribute ();
     self.specified = mapping.Load (self, attr);
     return self;
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:10,代码来源:ServiceAttribute.Partial.cs

示例3: FromTypeDefinition

 public static IEnumerable<GrantUriPermissionAttribute> FromTypeDefinition(TypeDefinition type)
 {
     IEnumerable<CustomAttribute> attrs = type.GetCustomAttributes ("Android.Content.GrantUriPermissionAttribute");
     if (!attrs.Any ())
         yield break;
     foreach (CustomAttribute attr in attrs) {
         var self = new GrantUriPermissionAttribute ();
         self.specified = mapping.Load (self, attr);
         yield return self;
     }
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:11,代码来源:GrantUriPermissionAttribute.Partial.cs

示例4: FromTypeDefinition

 public static IEnumerable<IntentFilterAttribute> FromTypeDefinition(TypeDefinition type)
 {
     IEnumerable<CustomAttribute> attrs = type.GetCustomAttributes ("Android.App.IntentFilterAttribute");
     if (!attrs.Any ())
         yield break;
     foreach (CustomAttribute attr in attrs) {
         var self = new IntentFilterAttribute (ToStringArray (attr.ConstructorArguments [0].Value));
         foreach (var e in attr.Properties) {
             self.specified.Add (e.Name);
             setters [e.Name] (self, e.Argument.GetSettableValue ());
         }
         yield return self;
     }
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:14,代码来源:IntentFilterAttribute.Partial.cs

示例5: FromTypeDefinition

 public static ContentProviderAttribute FromTypeDefinition(TypeDefinition type)
 {
     CustomAttribute attr = type.GetCustomAttributes ("Android.Content.ContentProviderAttribute")
         .SingleOrDefault ();
     if (attr == null)
         return null;
     var self = new ContentProviderAttribute (ToStringArray (attr.ConstructorArguments [0].Value));
     self.specified = mapping.Load (self, attr);
     self.specified.Add ("Authorities");
     return self;
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:11,代码来源:ContentProviderAttribute.Partial.cs


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