public static ModuleInfoAttribute GetModuleInfo(this ModuleType moduleType) { var description = moduleType.ToString(); var info = moduleType.GetType().GetField(description); return(Attribute.GetCustomAttribute(info, typeof(ModuleInfoAttribute)) as ModuleInfoAttribute ?? new ModuleInfoAttribute()); }
/// <summary> /// Set the required module to build to a new /// </summary> /// <param name="module"></param> public static void ResetRequiredStructure(this ModuleType module) { var mReqField = module.GetType().GetField( "mRequiredStructure", BindingFlags.NonPublic | BindingFlags.Instance); mReqField.SetValue(module, new ModuleTypeRef()); }