Beispiel #1
0
        public AssemblyClone(XDocument document)
        {
            foreach (var element in document.Root.Elements())
            {
                switch (element.Name.LocalName)
                {
                case "CodeBase":
                    codeBase = element.Value;
                    break;

                case "FullName":
                    fullName = element.Value;
                    break;

                case "Name":
                    assemblyName = new AssemblyNameClone(element);
                    break;

                case "Location":
                    assemblyLocation = element.Value;
                    break;

                case "GlobalAssemblyCache":
                    globalAssemblyCache = bool.Parse(element.Value);
                    break;

                case "ReferencedAssemblies":

                    var assemblyNames = element.XPathSelectElements("Assemblies/AssemblyNameClone").Select(e => new AssemblyNameClone(e)).ToList();

                    if (referencedAssemblies == null)
                    {
                        referencedAssemblies = new ReferencedAssemblies(assemblyNames);
                    }

                    break;

                case "CustomAttributeDataList":

                    customAttributesData = element.XPathSelectElements("CustomAttributeData").Select(e => new CustomAttributeData(e)).ToList();
                    break;

                default:
                    Debugger.Break();
                    break;
                }
            }
        }
Beispiel #2
0
 public AssemblyClone(Assembly assembly)
 {
     this.assembly     = assembly;
     this.assemblyName = new AssemblyNameClone(assembly.GetName());
 }