Example #1
0
 public static void EnsureHosting()
 {
     if (host != null)
     {
         return;
     }
     host = AppDomain.CurrentDomain.GetData(HOST_INSTANCE_NAME) as MyHost;
     if (host == null)
     {
         SetupHosting();
     }
 }
Example #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
        }
Example #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
        }
Example #4
0
		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);
		}
Example #5
0
		public static void EnsureHosting ()
		{
			if (host != null)
				return;
			host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
			if (host == null)
				SetupHosting ();
		}
Example #6
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
		}