Beispiel #1
0
        // ----------------------------------------------------------------------
        // Names
        // ----------------------------------------------------------------------

        private PE.AssemblyRefRow AssemblyNameToAssemblyRefRow(DllSaveContext ctxt, AssemblyName name)
        {
            var res = default(PE.AssemblyRefRow);
            if (!ctxt.AssemblyRefCache.TryGetValue(name, out res))
            {
                res = new PE.AssemblyRefRow
                      {
                          MajorVersion = (ushort)name.MajorVersion,
                          MinorVersion = (ushort)name.MinorVersion,
                          BuildNumber = (ushort)name.BuildNumber,
                          RevisionNumber = (ushort)name.RevisionNumber,
                          Flags = PE.AssemblyFlags.Retargetable,
                          PublicKeyOrToken = { Value = name.PublicKeyToken },
                          Name = { Value = name.Name },
                          Culture = { Value = name.Culture },
                          HashValue = { Value = null }
                      };
                ctxt.AssemblyRefCache.Add(name, res);
            }
            return res;
        }
Beispiel #2
0
        // ----------------------------------------------------------------------
        // Names
        // ----------------------------------------------------------------------

        private PE.AssemblyRefRow AssemblyNameToAssemblyRefRow(DllSaveContext ctxt, AssemblyName name)
        {
            var res = default(PE.AssemblyRefRow);

            if (!ctxt.AssemblyRefCache.TryGetValue(name, out res))
            {
                res = new PE.AssemblyRefRow
                {
                    MajorVersion     = (ushort)name.MajorVersion,
                    MinorVersion     = (ushort)name.MinorVersion,
                    BuildNumber      = (ushort)name.BuildNumber,
                    RevisionNumber   = (ushort)name.RevisionNumber,
                    Flags            = PE.AssemblyFlags.Retargetable,
                    PublicKeyOrToken = { Value = name.PublicKeyToken },
                    Name             = { Value = name.Name },
                    Culture          = { Value = name.Culture },
                    HashValue        = { Value = null }
                };
                ctxt.AssemblyRefCache.Add(name, res);
            }
            return(res);
        }