private static bool FPAssemblyLoaded() { if (_FP != null) { return(true); } if (FPRun) { return(false); } FPRun = true; try { Type FPType = AssemblyLoader.loadedAssemblies.SelectMany(a => a.assembly.GetExportedTypes()) .SingleOrDefault(t => t.FullName == FPContractTypeName); if (FPType == null) { DMC_MBE.LogFormatted_DebugOnly("Fine Print Type Not Found"); return(false); } _FPType = FPType; MethodInfo FPMethod = FPType.GetMethod("PartName", new Type[] { typeof(ContractParameter) }); if (FPMethod == null) { DMC_MBE.LogFormatted_DebugOnly("Fine Print String Method Not Found"); return(false); } _FP = (FPSci)Delegate.CreateDelegate(typeof(FPSci), FPMethod); DMC_MBE.LogFormatted("Fine Print Reflection Method Assigned"); return(_FP != null); } catch (Exception e) { DMC_MBE.LogFormatted("Exception While Loading Fine Print Accessor: {0}", e); } return(false); }
private static bool FPAssemblyLoaded() { if (_FP != null) return true; if (FPRun) return false; FPRun = true; try { Type FPType = AssemblyLoader.loadedAssemblies.SelectMany(a => a.assembly.GetExportedTypes()) .SingleOrDefault(t => t.FullName == FPContractTypeName); if (FPType == null) { DMC_MBE.LogFormatted_DebugOnly("Fine Print Type Not Found"); return false; } _FPType = FPType; MethodInfo FPMethod = FPType.GetMethod("PartName", new Type[] { typeof(ContractParameter) }); if (FPMethod == null) { DMC_MBE.LogFormatted_DebugOnly("Fine Print String Method Not Found"); return false; } _FP = (FPSci)Delegate.CreateDelegate(typeof(FPSci), FPMethod); DMC_MBE.LogFormatted("Fine Print Reflection Method Assigned"); return _FP != null; } catch (Exception e) { DMC_MBE.LogFormatted("Exception While Loading Fine Print Accessor: {0}", e); } return false; }