예제 #1
0
        public void Unload()
        {
            if (app != null && !this.localSubApp)
            {
                //AJ: Stop the SubApp gracefully
                this.app.Stop();
                this.app = null;

                //AJ: Remove the Remote Loader
                this.remoteLoader = null;

                //AJ: Unload the AppDomain
                AppDomain.Unload(this.appDomain);
                this.appDomain = null;
            }
        }
예제 #2
0
        public void Load()
        {
            if (app == null && !this.localSubApp)
            {
                //AJ: The base directory is the same as this appdomain because we'll need the ISubApp_V1
                this.appDomainSetup.ApplicationBase = System.AppDomain.CurrentDomain.BaseDirectory;
                this.appDomainSetup.ApplicationName = this.objectName;
                this.appDomainSetup.ShadowCopyFiles = @"true";

                //AJ: Create the new AppDomain
                this.appDomain = AppDomain.CreateDomain(this.objectName, null, this.appDomainSetup);

                //AJ: Create the Remote Loader in the new AppDomain and retrive a proxy copy of it
                this.remoteLoader = (RemoteLoader)appDomain.CreateInstanceFromAndUnwrap("TigerLoaderLib.dll", "Tiger.Loader.Lib.RemoteLoader");

                //AJ: Use the Remote Loader to load the SubApp and return a proxy copy of it
                this.app = (ISubApp_V1)this.remoteLoader.LoadObject(this.directory, this.filename, this.objectName);
                this.app.Start();
            }
        }