Пример #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;
     }
 }