Exemple #1
0
        void SweepResources(AssemblyDefinition assembly)
        {
            var resourcesToRemove = Annotations.GetResourcesToRemove(assembly);

            if (resourcesToRemove == null)
            {
                return;
            }

            var resources = assembly.MainModule.Resources;

            foreach (var resource in resourcesToRemove)
            {
                resources.Remove(resource);
            }
        }
Exemple #2
0
        void SweepResources(AssemblyDefinition assembly)
        {
            var resourcesToRemove = Annotations.GetResourcesToRemove(assembly);

            if (resourcesToRemove != null)
            {
                var resources = assembly.MainModule.Resources;

                for (int i = 0; i < resources.Count; i++)
                {
                    if (!(resources [i] is EmbeddedResource resource))
                    {
                        continue;
                    }

                    if (resourcesToRemove.Contains(resource.Name))
                    {
                        resources.RemoveAt(i--);
                    }
                }
            }
        }