コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: AssemblyNameCache.cs プロジェクト: zyonet/Pscx
 private static void InitializeCache(ref AssemblyNameCache cache, AssemblyCacheType type)
 {
     Utils.DoubleCheckInit <AssemblyNameCache>(ref cache, _syncRoot, delegate
     {
         return(new AssemblyNameCache(type));
     });
 }
コード例 #3
0
ファイル: AssemblyCache.cs プロジェクト: zyonet/Pscx
        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());
        }
コード例 #4
0
        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());
        }
コード例 #5
0
ファイル: AssemblyCache.cs プロジェクト: zyonet/Pscx
        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));
        }
コード例 #6
0
ファイル: AssemblyCache.cs プロジェクト: nickchal/pash
        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();
        }
コード例 #7
0
ファイル: AssemblyCache.cs プロジェクト: nickchal/pash
        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);
        }
コード例 #8
0
ファイル: AssemblyCache.cs プロジェクト: nickchal/pash
 public static IEnumerable<AssemblyName> GetAssemblies(AssemblyCacheType cacheType)
 {
     return GetAssemblies(null, cacheType);
 }
コード例 #9
0
ファイル: AssemblyNameCache.cs プロジェクト: zyonet/Pscx
        private AssemblyNameCache(AssemblyCacheType cacheType)
        {
            _type = cacheType;

            Refresh();
        }
コード例 #10
0
ファイル: NativeMethods.cs プロジェクト: nickchal/pash
 public static extern void GetCachePath(AssemblyCacheType dwCacheFlags, StringBuilder pwzCachePath, ref int pcchPath);
コード例 #11
0
ファイル: NativeMethods.cs プロジェクト: nickchal/pash
 public static extern void CreateAssemblyEnum(out IAssemblyEnum pEnum, IntPtr pUnkReserved, IAssemblyName pName,
     AssemblyCacheType dwFlags, IntPtr pvReserved);
コード例 #12
0
ファイル: AssemblyCache.cs プロジェクト: zyonet/Pscx
 public static IEnumerable <AssemblyName> GetAssemblies(AssemblyCacheType cacheType)
 {
     return(GetAssemblies(null, cacheType));
 }
コード例 #13
0
ファイル: NativeMethods.cs プロジェクト: zyonet/Pscx
 public static extern void GetCachePath(AssemblyCacheType dwCacheFlags, StringBuilder pwzCachePath, ref int pcchPath);
コード例 #14
0
ファイル: NativeMethods.cs プロジェクト: zyonet/Pscx
 public static extern void CreateAssemblyEnum(out IAssemblyEnum pEnum, IntPtr pUnkReserved, IAssemblyName pName,
                                              AssemblyCacheType dwFlags, IntPtr pvReserved);