Пример #1
0
        private static ILookup <AssemblyBinding, XElement> GetAssemblyBindings(XDocument document)
        {
            XElement runtime = document.Root.Element("runtime");
            IEnumerable <XElement> assemblyBindingElements = Enumerable.Empty <XElement>();

            if (runtime != null)
            {
                assemblyBindingElements = GetAssemblyBindingElements(runtime);
            }
            return(Enumerable.ToLookup(from dependentAssemblyElement in assemblyBindingElements select new {
                Binding = AssemblyBinding.Parse(dependentAssemblyElement),
                Element = dependentAssemblyElement
            }, p => p.Binding, p => p.Element));
        }
Пример #2
0
        private static ILookup <AssemblyBinding, XElement> GetAssemblyBindings(XDocument document)
        {
            XElement runtime = document.Root.Element("runtime");

            IEnumerable <XElement> assemblyBindingElements = Enumerable.Empty <XElement>();

            if (runtime != null)
            {
                assemblyBindingElements = GetAssemblyBindingElements(runtime);
            }

            // We're going to need to know which element is associated with what binding for removal
            var assemblyElementPairs = from dependentAssemblyElement in assemblyBindingElements
                                       select new {
                Binding = AssemblyBinding.Parse(dependentAssemblyElement),
                Element = dependentAssemblyElement
            };

            // Return a mapping from binding to element
            return(assemblyElementPairs.ToLookup(p => p.Binding, p => p.Element));
        }