Ejemplo n.º 1
0
        void OnClrVersionChanged()
        {
            var clrVersion = (Module.ClrVersion)clrVersionVM.SelectedItem;
            var clrValues  = ClrVersionValues.GetValues(clrVersion);

            if (clrValues == null)
            {
                return;
            }

            if (cor20HeaderRuntimeVersion != null)
            {
                cor20HeaderRuntimeVersion.Value = clrValues.Cor20HeaderRuntimeVersion;
            }
            if (tablesHeaderVersion != null)
            {
                tablesHeaderVersion.Value = clrValues.TablesHeaderVersion;
            }
            RuntimeVersion = clrValues.RuntimeVersion;
        }
Ejemplo n.º 2
0
        static ModuleDef CreateModuleDef(string name, Guid mvid, ClrVersion clrVersion, ModuleDef existingModule)
        {
            var       clrValues = ClrVersionValues.GetValues(clrVersion);
            ModuleDef module;

            if (existingModule == null)
            {
                module = new ModuleDefUser(name, mvid, clrValues.CorLibRef);
            }
            else
            {
                module      = existingModule;
                module.Name = name;
                module.Mvid = mvid;
                OverwriteAssembly(module.CorLibTypes.AssemblyRef, clrValues.CorLibRef);
            }
            module.UpdateRowId(module);
            module.RuntimeVersion            = clrValues.RuntimeVersion;
            module.Cor20HeaderRuntimeVersion = clrValues.Cor20HeaderRuntimeVersion;
            module.TablesHeaderVersion       = clrValues.TablesHeaderVersion;
            module.Location = string.Empty;
            return(module);
        }