示例#1
0
 void ReleaseDomain()
 {
     lock (this) {
         if (--useCount == 0)
         {
             AppDomain.Unload(domain);
             domain            = null;
             remoteSetupDomain = null;
         }
     }
 }
示例#2
0
 RemoteSetupDomain GetDomain()
 {
     lock (this) {
         if (useCount++ == 0)
         {
             domain            = AppDomain.CreateDomain("SetupDomain", null, AppDomain.CurrentDomain.SetupInformation);
             remoteSetupDomain = (RemoteSetupDomain)domain.CreateInstanceFromAndUnwrap(typeof(RemoteSetupDomain).Assembly.Location, typeof(RemoteSetupDomain).FullName);
         }
         return(remoteSetupDomain);
     }
 }
示例#3
0
 void ReleaseDomain()
 {
     lock (this) {
         if (--useCount == 0)
         {
             AppDomain.Unload(domain);
             domain            = null;
             remoteSetupDomain = null;
             AppDomain.CurrentDomain.AssemblyResolve -= MonoAddinsAssemblyResolve;
         }
     }
 }
示例#4
0
		RemoteSetupDomain GetDomain ()
		{
			lock (this) {
				if (useCount++ == 0) {
					AppDomain.CurrentDomain.AssemblyResolve += MonoAddinsAssemblyResolve;
					domain = AppDomain.CreateDomain ("SetupDomain", null, AppDomain.CurrentDomain.SetupInformation);
					var type = typeof(RemoteSetupDomain);
					remoteSetupDomain = (RemoteSetupDomain) domain.CreateInstanceFromAndUnwrap (type.Assembly.Location, type.FullName);
				}
				return remoteSetupDomain;
			}
		}
示例#5
0
        public void GetAddinDescription(IProgressStatus monitor, AddinRegistry registry, string file, string outFile)
        {
            RemoteProgressStatus remMonitor = new RemoteProgressStatus(monitor);

            try {
                RemoteSetupDomain rsd = GetDomain();
                rsd.GetAddinDescription(remMonitor, registry.RegistryPath, registry.StartupDirectory, registry.DefaultAddinsFolder, registry.AddinCachePath, file, outFile);
            } catch (Exception ex) {
                throw new ProcessFailedException(remMonitor.ProgessLog, ex);
            } finally {
                System.Runtime.Remoting.RemotingServices.Disconnect(remMonitor);
                ReleaseDomain();
            }
        }
示例#6
0
        public void GenerateScanDataFiles(IProgressStatus monitor, AddinRegistry registry, string scanFolder, bool recursive)
        {
            RemoteProgressStatus remMonitor = new RemoteProgressStatus(monitor);

            try {
                RemoteSetupDomain rsd = GetDomain();
                rsd.PreScan(remMonitor, registry.RegistryPath, registry.StartupDirectory, registry.DefaultAddinsFolder, registry.AddinCachePath, scanFolder, recursive);
            } catch (Exception ex) {
                throw new ProcessFailedException(remMonitor.ProgessLog, ex);
            } finally {
                System.Runtime.Remoting.RemotingServices.Disconnect(remMonitor);
                ReleaseDomain();
            }
        }
示例#7
0
		void ReleaseDomain ()
		{
			lock (this) {
				if (--useCount == 0) {
					AppDomain.Unload (domain);
					domain = null;
					remoteSetupDomain = null;
					AppDomain.CurrentDomain.AssemblyResolve -= MonoAddinsAssemblyResolve;
				}
			}
		}
示例#8
0
 void ReleaseDomain()
 {
     lock (this) {
         if (--useCount == 0) {
             AppDomain.Unload (domain);
             domain = null;
             remoteSetupDomain = null;
         }
     }
 }
示例#9
0
 RemoteSetupDomain GetDomain()
 {
     lock (this) {
         if (useCount++ == 0) {
             domain = AppDomain.CreateDomain ("SetupDomain");
             remoteSetupDomain = (RemoteSetupDomain) domain.CreateInstanceFromAndUnwrap (typeof(RemoteSetupDomain).Assembly.Location, typeof(RemoteSetupDomain).FullName);
         }
         return remoteSetupDomain;
     }
 }