public ModuleInstanceCache(ModuleDatabase owner, Assembly assembly)
 {
     if (owner == null) {
         throw new ArgumentNullException("owner");
     }
     if (assembly == null) {
         throw new ArgumentNullException("assembly");
     }
     this.owner = owner;
     assemblyInfo = ModuleAssemblyInfo.Get(assembly);
     dirty = true;
     assemblyInfo.Inventory.AssertEngineVersion(owner.ManagementConnectionProvider.EngineVersion.Major);
 }
Ejemplo n.º 2
0
 public static ModuleAssemblyInfo Get(Assembly assembly)
 {
     if (assembly == null) {
         throw new ArgumentNullException("assembly");
     }
     lock (cache) {
         ModuleAssemblyInfo result;
         if (!cache.TryGetValue(assembly, out result)) {
             result = new ModuleAssemblyInfo(assembly);
             cache.Add(assembly, result);
         }
         return result;
     }
 }