private AssemblyNameCache GetCache(string path) { AssemblyCacheType type = GetCacheType(path); switch (type) { case AssemblyCacheType.Gac: if (IsRefreshSet) { AssemblyNameCache.Gac.Refresh(); } return(AssemblyNameCache.Gac); case AssemblyCacheType.Download: if (IsRefreshSet) { AssemblyNameCache.Download.Refresh(); } return(AssemblyNameCache.Download); case AssemblyCacheType.NGen: if (IsRefreshSet) { AssemblyNameCache.NGen.Refresh(); } return(AssemblyNameCache.NGen); } return(null); }
private static void InitializeCache(ref AssemblyNameCache cache, AssemblyCacheType type) { Utils.DoubleCheckInit <AssemblyNameCache>(ref cache, _syncRoot, delegate { return(new AssemblyNameCache(type)); }); }
private static string GetCachePath(AssemblyCacheType cache) { int bufferSize = NativeMethods.MAX_PATH; StringBuilder buffer = new StringBuilder(bufferSize); NativeMethods.GetCachePath(cache, buffer, ref bufferSize); return(buffer.ToString()); }
public static string GetCachePath(AssemblyCacheType type) { int pcchPath = 0; UnmanagedApi.FusionNative.GetCachePath((uint)type, null, ref pcchPath); var cachePath = new StringBuilder(pcchPath); UnmanagedApi.FusionNative.GetCachePath((uint)type, cachePath, ref pcchPath); return(cachePath.ToString()); }
public static IEnumerable <AssemblyName> GetAssemblies(string partialName, AssemblyCacheType cacheType) { IAssemblyEnum enumerator; IAssemblyName assemblyName = null; if (partialName != null) { assemblyName = AssemblyCache.CreateAssemblyName(partialName); } NativeMethods.CreateAssemblyEnum(out enumerator, IntPtr.Zero, assemblyName, cacheType, IntPtr.Zero); return(new AssemblyCacheSearcher(enumerator)); }
private static string GetCachePath(AssemblyCacheType cache) { int bufferSize = NativeMethods.MAX_PATH; StringBuilder buffer = new StringBuilder(bufferSize); NativeMethods.GetCachePath(cache, buffer, ref bufferSize); return buffer.ToString(); }
public static IEnumerable<AssemblyName> GetAssemblies(string partialName, AssemblyCacheType cacheType) { IAssemblyEnum enumerator; IAssemblyName assemblyName = null; if (partialName != null) { assemblyName = AssemblyCache.CreateAssemblyName(partialName); } NativeMethods.CreateAssemblyEnum(out enumerator, IntPtr.Zero, assemblyName, cacheType, IntPtr.Zero); return new AssemblyCacheSearcher(enumerator); }
public static IEnumerable<AssemblyName> GetAssemblies(AssemblyCacheType cacheType) { return GetAssemblies(null, cacheType); }
private AssemblyNameCache(AssemblyCacheType cacheType) { _type = cacheType; Refresh(); }
public static extern void GetCachePath(AssemblyCacheType dwCacheFlags, StringBuilder pwzCachePath, ref int pcchPath);
public static extern void CreateAssemblyEnum(out IAssemblyEnum pEnum, IntPtr pUnkReserved, IAssemblyName pName, AssemblyCacheType dwFlags, IntPtr pvReserved);
public static IEnumerable <AssemblyName> GetAssemblies(AssemblyCacheType cacheType) { return(GetAssemblies(null, cacheType)); }