Example #1
0
        public NativeManifest(string manifestText)
        {
            if (string.IsNullOrEmpty(manifestText)) {
                manifestText = DefaultManifestXml;
            }
            _assembly = XDocument.Parse(manifestText);

            _noInherit = new NoInherit(_assembly.Root);
            _assemblyIdentity = new AssemblyIdentity(_assembly.Root);
            _trustInfo = new TrustInfo(_assembly.Root);
            _asmV3Application = new AsmV3Application(_assembly.Root);
            _dependentAssemblies = new DependentAssemblies(_assembly.Root);
            _compatibility = new Compatibility(_assembly.Root);
            _files = new AssemblyFile(_assembly.Root);
            Modified = false;
        }
Example #2
0
 public void AddDependency(string name, FourPartVersion version, Architecture arch, string publicKeyToken, string language = "*", AssemblyType assemblyType = AssemblyType.win32, BindingRedirect bindingRedirect = null)
 {
     if (!(from dat in DependentAssemblyElements
         let assemblyIdentity = new AssemblyIdentity(dat)
         where
             assemblyIdentity.Name == name &&
                 assemblyIdentity.Version == version &&
                     assemblyIdentity.Architecture == arch &&
                         assemblyIdentity.PublicKeyToken == publicKeyToken &&
                             ((language == "*" && string.IsNullOrEmpty(assemblyIdentity.Language)) || assemblyIdentity.Language == language)
         select assemblyIdentity).Any()) {
         // add another.
         var dat = new XElement(DependencyTag, new XElement(DependentAssemblyTag));
         var identity = new AssemblyIdentity(dat.Elements().FirstOrDefault()) {
             AssemblyType = assemblyType,
             Name = name,
             Version = version,
             Architecture = arch,
             PublicKeyToken = publicKeyToken,
             Language = language,
             BindingRedirect = bindingRedirect
         };
         _parentElement.Add(dat);
     }
 }