private bool IsConstructorVisible(ConstructorInfo constructor) { return(constructor.IsPublic || constructor.IsFamily || constructor.IsFamilyOrAssembly || (constructor.IsAssembly && ProxyUtil.AreInternalsVisibleToDynamicProxy(constructor.DeclaringType.GetTypeInfo().Assembly))); }
private MethodAttributes ObtainAttributes() { var methodInfo = Method; var attributes = MethodAttributes.Virtual; if (methodInfo.IsFinal || Method.DeclaringType.IsInterface) { attributes |= MethodAttributes.NewSlot; } if (methodInfo.IsPublic) { attributes |= MethodAttributes.Public; } if (methodInfo.IsHideBySig) { attributes |= MethodAttributes.HideBySig; } if ( ProxyUtil.IsInternal(methodInfo) && ProxyUtil.AreInternalsVisibleToDynamicProxy(methodInfo.DeclaringType.Assembly) ) { attributes |= MethodAttributes.Assembly; } if (methodInfo.IsFamilyAndAssembly) { attributes |= MethodAttributes.FamANDAssem; } else if (methodInfo.IsFamilyOrAssembly) { attributes |= MethodAttributes.FamORAssem; } else if (methodInfo.IsFamily) { attributes |= MethodAttributes.Family; } if (Standalone == false) { attributes |= MethodAttributes.SpecialName; } return(attributes); }
private static bool IsInternalAndNotVisibleToDynamicProxy(MethodInfo method) { return(ProxyUtil.IsInternal(method) && ProxyUtil.AreInternalsVisibleToDynamicProxy(method.DeclaringType.GetTypeInfo().Assembly) == false); }
public static bool IsInternalToDynamicProxy(this Assembly asm) { return(ProxyUtil.AreInternalsVisibleToDynamicProxy(asm)); }