public EntryPoint(XmlNode elm, XmlNamespaceManager nsmgr) { if (elm.Attributes["name"] != null) Name = elm.Attributes["name"].Value; if (elm.Attributes["dependencyName"] != null) DependencyName = elm.Attributes["dependencyName"].Value; // Load the assembly identity XmlNode node = elm.SelectSingleNode("asmv2:assemblyIdentity", nsmgr); if (node != null) AssemblyIdentity = new AssemblyIdentity(this, node, nsmgr); // Load the command line node = elm.SelectSingleNode("asmv2:commandLine", nsmgr); if (node != null) CommandLine = new CommandLine(node, nsmgr); }
virtual public XmlDocument LoadFromUri(Uri uri, string username, string password, string domain) { WebClient client = new WebClient(); if (username != null && password != null) client.Credentials = new NetworkCredential(username, password, domain); // Create an XPath document using the downloaded manifest Stream clientStream = client.OpenRead(uri); Document = new XmlDocument(); Document.Load(clientStream); clientStream.Close(); // Load a namespace manager for this Manifest NamespaceManager = GetNamespaceManager(Document); // Record Uri, username, password, and domain Uri = uri; Username = username; Password = password; Domain = domain; // Load assembly identity XmlNode aiNode = Document.SelectSingleNode( "/asmv1:assembly/asmv1:assemblyIdentity", NamespaceManager); if (aiNode != null) { AssemblyIdentity = new AssemblyIdentity(this, aiNode, NamespaceManager); } // Load each dependency foreach (XmlNode node in Document.SelectNodes( "/asmv1:assembly/asmv2:dependency", NamespaceManager)) { Dependencies.Add(new Dependency(this, node, NamespaceManager)); } _SuccessfullyLoaded = true; return Document; }
public DependentAssembly(Manifest parent, XmlNode elm, XmlNamespaceManager nsmgr) : base(parent, elm, nsmgr) { _XmlElement = elm as XmlElement; _XmlNsMgr = nsmgr; if (elm.Attributes["codebase"] != null) CodeBase = elm.Attributes["codebase"].Value; if (elm.Attributes["visible"] != null) Visible = elm.Attributes["visible"].Value; if (elm.Attributes["preRequisite"] != null) Prerequisite = Convert.ToBoolean(elm.Attributes["preRequisite"].Value); if (elm.Attributes["dependencyType"] != null) DependencyType = (DependencyTypes)Enum.Parse(typeof(DependencyTypes), elm.Attributes["dependencyType"].Value, true); if (elm.Attributes["size"] != null) Size = long.Parse(elm.Attributes["size"].Value); // Load assembly identity XmlNode aiNode = elm.SelectSingleNode("asmv2:assemblyIdentity", nsmgr); if (aiNode != null) { AssemblyIdentity = new AssemblyIdentity(this, aiNode, nsmgr); } // Load the assembly hash XmlNode hashNode = elm.SelectSingleNode(@"asmv2:hash", nsmgr); if (hashNode != null) { XmlNode hashValueNode = hashNode.SelectSingleNode(@"dsig:DigestValue", nsmgr); if (hashValueNode != null && hashValueNode.HasChildNodes) { Hash = hashValueNode.FirstChild.Value; } } }