110,536
社区成员
发帖
与我相关
我的任务
分享
class RemoteSetupDomain : MarshalByRefObject
{
public override object InitializeLifetimeService()
{
return null;
}
public void Scan(IProgressStatus monitor, string registryPath, string startupDir, string scanFolder, string[] filesToIgnore)
{
AddinDatabase.RunningSetupProcess = true;
AddinRegistry reg = new AddinRegistry(registryPath, startupDir);
StringCollection files = new StringCollection();
for (int n = 3; n < filesToIgnore.Length; n++)
files.Add(filesToIgnore[n]);
reg.ScanFolders(monitor, scanFolder, files);
}
public void GetAddinDescription(IProgressStatus monitor, string registryPath, string startupDir, string file, string outFile)
{
AddinDatabase.RunningSetupProcess = true;
AddinRegistry reg = new AddinRegistry(registryPath, startupDir);
reg.ParseAddin(monitor, file, outFile);
}
}
class SetupDomain: ISetupHandler
{
AppDomain domain;
RemoteSetupDomain remoteSetupDomain;
int useCount;
public void Scan (IProgressStatus monitor, string registryPath, string startupDir, string scanFolder, string[] filesToIgnore)
{
RemoteProgressStatus remMonitor = new RemoteProgressStatus (monitor);
try {
RemoteSetupDomain rsd = GetDomain ();
rsd.Scan (remMonitor, registryPath, startupDir, scanFolder, filesToIgnore);
} catch (Exception ex) {
throw new ProcessFailedException (remMonitor.ProgessLog, ex);
} finally {
System.Runtime.Remoting.RemotingServices.Disconnect (remMonitor);
ReleaseDomain ();
}
}
}