123456789101112131415161718192021222324252627282930 |
- using System;
- using System.Reflection;
- namespace prBrowser
- {
- public class XYSLocalLoader
- {
- private AppDomain appDomain;
- private RemoteLoader remoteLoader;
- public XYSLocalLoader()
- {
- appDomain = AppDomain.CreateDomain("XYSDomain", null, AppDomain.CurrentDomain.BaseDirectory, "bin", shadowCopyFiles: true);
- string name = Assembly.GetExecutingAssembly().GetName().FullName;
- remoteLoader = (RemoteLoader)appDomain.CreateInstanceAndUnwrap(name, typeof(RemoteLoader).FullName);
- }
- public string LoadAssembly(string input)
- {
- return remoteLoader.GetValue(input);
- }
- public void Unload()
- {
- AppDomain.Unload(appDomain);
- appDomain = null;
- }
- }
- }
|