예제 #1
0
 public static void EnsureHosting()
 {
     if (host != null)
     {
         return;
     }
     host = AppDomain.CurrentDomain.GetData(HOST_INSTANCE_NAME) as MyHost;
     if (host == null)
     {
         SetupHosting();
     }
 }
예제 #2
0
        public static void EnsureHosting()
        {
            if (host != null)
            {
                return;
            }
#if TARGET_JVM
            host = new MyHost();
            return;
#else
            host = AppDomain.CurrentDomain.GetData(HOST_INSTANCE_NAME) as MyHost;
            if (host == null)
            {
                SetupHosting();
            }
#endif
        }
예제 #3
0
        public static void SetupHosting(WebTestResourcesSetupAttribute.SetupHandler resHandler)
        {
#if !TARGET_JVM
            if (host == null)
            {
                host = AppDomain.CurrentDomain.GetData(HOST_INSTANCE_NAME) as MyHost;
            }
#endif
            if (host != null)
            {
                CleanApp();
            }
#if TARGET_JVM
            host = new MyHost();
            return;
#else
            if (resHandler == null)
            {
                resHandler = CheckResourcesSetupHandler();
            }
            if (resHandler == null)
            {
                CopyResources();
            }
            else
            {
                resHandler();
            }

            foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies())
            {
                LoadAssemblyRecursive(ass);
            }

            foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies())
            {
                CopyAssembly(ass, binDir);
            }

            host = (MyHost)ApplicationHost.CreateApplicationHost(typeof(MyHost), VIRTUAL_BASE_DIR, baseDir);
            AppDomain.CurrentDomain.SetData(HOST_INSTANCE_NAME, host);
            host.AppDomain.SetData(HOST_INSTANCE_NAME, host);
            host.AppDomain.DomainUnload += new EventHandler(_unloadHandler.OnUnload);
#endif
        }
예제 #4
0
파일: WebTest.cs 프로젝트: nobled/mono
		public static void SetupHosting (WebTestResourcesSetupAttribute.SetupHandler resHandler)
		{
			if (host == null)
				host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
			if (host != null)
				CleanApp ();
			if (resHandler == null)
				resHandler = CheckResourcesSetupHandler ();
			if (resHandler == null)
				CopyResources ();
			else
				resHandler ();
			
			foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies ())
				LoadAssemblyRecursive (ass);

			foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies ())
				CopyAssembly (ass, binDir);

			host = (MyHost) ApplicationHost.CreateApplicationHost (typeof (MyHost), VIRTUAL_BASE_DIR, baseDir);
			AppDomain.CurrentDomain.SetData (HOST_INSTANCE_NAME, host);
			host.AppDomain.SetData (HOST_INSTANCE_NAME, host);
 			host.AppDomain.DomainUnload += new EventHandler (_unloadHandler.OnUnload);
		}
예제 #5
0
파일: WebTest.cs 프로젝트: nobled/mono
		public static void EnsureHosting ()
		{
			if (host != null)
				return;
			host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
			if (host == null)
				SetupHosting ();
		}
예제 #6
0
파일: WebTest.cs 프로젝트: runefs/Marvin
		public static void EnsureHosting ()
		{
			if (host != null)
				return;
#if TARGET_JVM
			host = new MyHost ();
			return;
#else
			host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
			if (host == null)
				SetupHosting ();
#endif
		}