Defined
All modules add a field in the partial class Defined
.
public partial class Defined {
bool Wonderland_ColorMatrix;
}
Test availability
// with common
if (Defined.Contains("Wonderland_ColorMatrix")) ...
// without common
var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic;
if (typeof(Defined).GetField("Wonderland_ColorMatrix", flags) != null) ...
// In another library
var defined = null;
foreach (var assembly in System.AppDomain.CurrentDomain.GetAssemblies()) {
defined = assembly.GetType("Defined");
if (defined != null) break;
}
if (defined != null) {
var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic;
if (defined.GetField("Wonderland_Common", flags) != null) ...
}