Refactored some of the hardware monitoring code and fixed a few code inspection warnings.

This commit is contained in:
Michael Möller
2010-09-21 20:32:36 +00:00
parent dfb06376d6
commit bcde768e25
44 changed files with 437 additions and 472 deletions
+3 -5
View File
@@ -43,19 +43,17 @@ using System.Runtime.InteropServices;
namespace OpenHardwareMonitor.Hardware {
internal sealed class PInvokeDelegateFactory {
internal static class PInvokeDelegateFactory {
private static ModuleBuilder moduleBuilder =
private static readonly ModuleBuilder moduleBuilder =
AppDomain.CurrentDomain.DefineDynamicAssembly(
new AssemblyName("PInvokeDelegateFactoryInternalAssembly"),
AssemblyBuilderAccess.Run).DefineDynamicModule(
"PInvokeDelegateFactoryInternalModule");
private static IDictionary<DllImportAttribute, Type> wrapperTypes =
private static readonly IDictionary<DllImportAttribute, Type> wrapperTypes =
new Dictionary<DllImportAttribute, Type>();
private PInvokeDelegateFactory() { }
public static void CreateDelegate<T>(DllImportAttribute dllImportAttribute,
out T newDelegate) where T : class
{