I'm reflecting a C++/CLI method that has the following signature:
void foo(long n);
This translates into C# as:
void foo(int modopt(IsLong) n);
How can I find if an int parameter is actually a C++/CLI long by reflection?
I'm reflecting a C++/CLI method that has the following signature:
void foo(long n);
This translates into C# as:
void foo(int modopt(IsLong) n);
How can I find if an int parameter is actually a C++/CLI long by reflection?
Check the ParameterInfo
instance's optional custom modifiers:
bool IsLongParameter(System.Reflection.ParameterInfo p) {
Type[] modifiers = p.GetOptionalCustomModifiers();
return modifiers.Contains(typeof(System.Runtime.CompilerServices.IsLong));
}