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