コード例 #1
0
            public void Dispose()
            {
                AppDomain separateAppDomain = this._separateAppDomain;

                if (separateAppDomain != null)
                {
                    AppDomain.Unload(separateAppDomain);
                    this._separateAppDomain = null;
                }
                this._regexCompilationProxy = null;
            }
コード例 #2
0
 public RegexCompilationProxyWrapper(bool alwaysCompileRegexInSeparateAppDomain)
 {
     if (alwaysCompileRegexInSeparateAppDomain)
     {
         AppDomain separateAppDomain = this._separateAppDomain = AppDomain.CreateDomain("RegexCompiler Isolation AppDomain", null, AppDomain.CurrentDomain.SetupInformation);
         Assembly  assembly          = Assembly.GetExecutingAssembly();
         if (!assembly.GlobalAssemblyCache)
         {
             separateAppDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs e)
             {
                 Assembly executingAssembly = Assembly.GetExecutingAssembly();
                 return((e.Name == executingAssembly.FullName) ? executingAssembly : null);
             };
         }
         this._regexCompilationProxy = (RegexCompilationProxy)separateAppDomain.CreateInstanceAndUnwrap(assembly.FullName, typeof(RegexCompilationProxy).FullName);
     }
     else
     {
         this._regexCompilationProxy = new RegexCompilationProxy();
     }
 }
コード例 #3
0
ファイル: RegexCompiler.cs プロジェクト: cjheath/NORMA
			public void Dispose()
			{
				AppDomain separateAppDomain = this._separateAppDomain;
				if (separateAppDomain != null)
				{
					AppDomain.Unload(separateAppDomain);
					this._separateAppDomain = null;
				}
				this._regexCompilationProxy = null;
			}
コード例 #4
0
ファイル: RegexCompiler.cs プロジェクト: cjheath/NORMA
			public RegexCompilationProxyWrapper(bool alwaysCompileRegexInSeparateAppDomain)
			{
				if (alwaysCompileRegexInSeparateAppDomain)
				{
					AppDomain separateAppDomain = this._separateAppDomain = AppDomain.CreateDomain("RegexCompiler Isolation AppDomain", null, AppDomain.CurrentDomain.SetupInformation);
					Assembly assembly = Assembly.GetExecutingAssembly();
					if (!assembly.GlobalAssemblyCache)
					{
						separateAppDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs e)
						{
							Assembly executingAssembly = Assembly.GetExecutingAssembly();
							return (e.Name == executingAssembly.FullName) ? executingAssembly : null;
						};
					}
					this._regexCompilationProxy = (RegexCompilationProxy)separateAppDomain.CreateInstanceAndUnwrap(assembly.FullName, typeof(RegexCompilationProxy).FullName);
				}
				else
				{
					this._regexCompilationProxy = new RegexCompilationProxy();
				}
			}