static bool HasMatchingPlatformAttribute(string expectedAttributeName, CustomAttribute attribute, Platforms platform) { if (attribute.Constructor.DeclaringType.Name == expectedAttributeName) { byte attrPlatform = (byte)attribute.ConstructorArguments[0].Value; if (attrPlatform == Helpers.GetPlatformManagedValue(platform)) { return(true); } } return(false); }