示例#1
0
 public void PrintMyMethodsCustomAttribute()
 {
     MyCustomAttribute[] myMethodAttributes = AttributeHelpers.GetMethodsCustomAttribute <MyCustomAttribute>(typeof(SomeClass));
     if (myMethodAttributes == null)
     {
         Console.WriteLine("The Attributes were not found");
     }
     else
     {
         foreach (var myCustomAttribute in myMethodAttributes)
         {
             Console.WriteLine($"The Name is: {myCustomAttribute.Name}");
             Console.WriteLine($"The Params are: {string.Join(", ", myCustomAttribute.Params)}");
         }
     }
 }