Exemplo n.º 1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (dependencies != null)
     {
         dependencies.Dispose();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            if (dependencies != null)
            {
                dependencies.Dispose();
            }

            foreach (var assembly in assemblyContainer.LoadedAssemblies)
            {
                // Unregisters assemblies that have been registered in Package.Load => Package.LoadAssemblyReferencesForPackage
                AssemblyRegistry.Unregister(assembly.Value);

                // Unload assembly
                assemblyContainer.UnloadAssembly(assembly.Value);
            }
        }
Exemplo n.º 3
0
        public override void Initialize()
        {
            base.Initialize();

            TypeFactory = new TypeDescriptorFactory();
            var assetDesc = TypeFactory.Find(typeof(TestAssetUpdate));

            memberMyClass = assetDesc.Members.FirstOrDefault(member => member.Name == "MyClass");

            if (session != null)
            {
                session.Dispose();
                dependencyManager.Dispose();
            }

            package           = new Package();
            session           = new PackageSession(package);
            dependencyManager = new AssetDependencyManager(session);
            assetUpdater      = new AssetUpdater(dependencyManager);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            if (dependencies != null)
            {
                dependencies.Dispose();
            }

            var loadedAssemblies = packages.SelectMany(x => x.LoadedAssemblies).ToList();

            for (int index = loadedAssemblies.Count - 1; index >= 0; index--)
            {
                var loadedAssembly = loadedAssemblies[index];
                if (loadedAssembly == null)
                {
                    continue;
                }

                // Unregisters assemblies that have been registered in Package.Load => Package.LoadAssemblyReferencesForPackage
                AssemblyRegistry.Unregister(loadedAssembly.Assembly);

                // Unload assembly
                assemblyContainer.UnloadAssembly(loadedAssembly.Assembly);
            }
        }