mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
adding extension methods (#1938)
This commit is contained in:
parent
26c02199ba
commit
3a35b0e9de
@ -148,6 +148,26 @@ public static CustomAttribute GetCustomAttribute(this ICustomAttributeProvider m
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static CustomAttribute GetCustomAttribute(this ICustomAttributeProvider method, TypeReference attribute)
|
||||
{
|
||||
foreach (CustomAttribute ca in method.CustomAttributes)
|
||||
{
|
||||
if (ca.AttributeType.FullName == attribute.FullName)
|
||||
return ca;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static bool HasCustomAttribute(this ICustomAttributeProvider attributeProvider, string attributeName)
|
||||
{
|
||||
foreach (CustomAttribute ca in attributeProvider.CustomAttributes)
|
||||
{
|
||||
if (ca.AttributeType.FullName == attributeName)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasCustomAttribute(this ICustomAttributeProvider attributeProvider, TypeReference attribute)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user