コード例 #1
0
		public static void DestroyResolver(AppDomainTypeResolver resolver)
		{
			if (resolver == null) throw new ArgumentNullException("resolver");

			ThreadPool.QueueUserWorkItem(delegate
			                             {
			                             	AppDomain.Unload(resolver.Domain);
			                             });
		}
コード例 #2
0
ファイル: AppDomainTypeResolver.cs プロジェクト: ALyman/ILSpy
        public static AppDomainTypeResolver GetIntoNewAppDomain(string baseDir)
        {
            AppDomainSetup info = new AppDomainSetup();

            info.ApplicationBase = Environment.CurrentDirectory;
            AppDomain             domain   = AppDomain.CreateDomain("AppDomainTypeResolver", null, info, new PermissionSet(PermissionState.Unrestricted));
            AppDomainTypeResolver resolver = (AppDomainTypeResolver)domain.CreateInstanceAndUnwrap(typeof(AppDomainTypeResolver).Assembly.FullName,
                                                                                                   typeof(AppDomainTypeResolver).FullName, false, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new object[] { domain, baseDir }, null, null, null);

            return(resolver);
        }
コード例 #3
0
ファイル: AppDomainTypeResolver.cs プロジェクト: yicong/Catel
        public static void DestroyResolver(AppDomainTypeResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            ThreadPool.QueueUserWorkItem(delegate
            {
                AppDomain.Unload(resolver.Domain);
            });
        }