Exemple #1
0
 /// <summary>
 /// Load a manifest resource from an executable file.
 /// </summary>
 /// <param name="filename">Name of an executable file (.exe or .dll).</param>
 /// <param name="manifestType">Manifest resource type.</param>
 public void LoadFrom(string filename, Kernel32.ManifestType manifestType)
 {
     base.LoadFrom(filename,
                   new ResourceId((uint)manifestType),
                   new ResourceId(Kernel32.ResourceTypes.RT_MANIFEST),
                   Kernel32.LANG_NEUTRAL);
 }
Exemple #2
0
 /// <summary>
 /// A new executable manifest.
 /// </summary>
 /// <param name="manifestType">Manifest type.</param>
 public ManifestResource(Kernel32.ManifestType manifestType)
     : base(IntPtr.Zero,
            IntPtr.Zero,
            new ResourceId(Kernel32.ResourceTypes.RT_MANIFEST),
            new ResourceId((uint)manifestType),
            Kernel32.LANG_NEUTRAL,
            0)
 {
     _manifest = new XmlDocument();
     _manifest.LoadXml(
         "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
         "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\" />");
     _size = Encoding.UTF8.GetBytes(_manifest.OuterXml).Length;
 }