コード例 #1
0
        /// <inheritdoc />
        public IAssembly[] GetAssemblies()
        {
            System.Reflection.Assembly[] assemblies = AppDomainInstance.GetAssemblies();
            IAssembly[] wrappedAssemblies           = new IAssembly[assemblies.Length];

            for (int i = 0; i < wrappedAssemblies.Length; i++)
            {
                wrappedAssemblies[i] = new AssemblyWrap(assemblies[i]);
            }

            return(wrappedAssemblies);
        }
コード例 #2
0
        /// <summary>
        ///     Private thread-safe method which dismantles an app domain for dependency management.
        /// </summary>
        private static void TearDownApplicationDomain()
        {
            lock (synchObj)
            {
                if (!ready)
                {
                    return;
                }

                // cleanup
                if ((object)AppDomainInstance != null)
                {
                    AppDomainInstance.Dispose();
                }

                AppDomain.CurrentDomain.DomainUnload -= new EventHandler(CurrentDomain_DomainUnload);
                AppDomain.CurrentDomain.AssemblyLoad -= new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
            }
        }
コード例 #3
0
ファイル: CreateBundles.cs プロジェクト: everlive/cassette
        public GivenConfigurationClassInAssembly_WhenExecute()
        {
            originalDirectory = Environment.CurrentDirectory;
            path = new TempDirectory();

            var assemblyPath = Path.Combine(path, "Test.dll");

            Configuration.GenerateAssembly(assemblyPath);

            File.WriteAllText(Path.Combine(path, "test.css"), "p { background-image: url(test.png); }");
            File.WriteAllText(Path.Combine(path, "test.png"), "");

            using (var container = new AppDomainInstance <CreateBundles>())
            {
                var task = container.Value;
                task.Assemblies              = new[] { assemblyPath };
                manifestFilename             = Path.Combine(path, "cassette.xml");
                Environment.CurrentDirectory = path;
                task.Output = manifestFilename;
                task.Execute();
            }
        }
コード例 #4
0
 /// <inheritdoc />
 public void SetData(string name, object data)
 {
     AppDomainInstance.SetData(name, data);
 }
コード例 #5
0
 /// <inheritdoc />
 public IAssembly Load(IAssemblyName assemblyRef)
 {
     return(new AssemblyWrap(AppDomainInstance.Load(assemblyRef.AssemblyNameInstance)));
 }
コード例 #6
0
 /// <inheritdoc />
 public object GetData(string name)
 {
     return(AppDomainInstance.GetData(name));
 }