예제 #1
0
 public void Execute()
 {
     for (int i = 0; i < newTypeNodeCreators.Length; i++)
     {
         newTypeNodeCreators[i].Add();
     }
     for (int i = 0; i < existingTypeNodeUpdaters.Length; i++)
     {
         existingTypeNodeUpdaters[i].Add();
     }
     if (origAssemblyCustomAttributes != null && newAssemblyCustomAttributes != null)
     {
         modNode.Document.AssemblyDef.CustomAttributes.Clear();
         foreach (var ca in newAssemblyCustomAttributes)
         {
             modNode.Document.AssemblyDef.CustomAttributes.Add(ca);
         }
     }
     if (origModuleCustomAttributes != null && newModuleCustomAttributes != null)
     {
         modNode.Document.ModuleDef.CustomAttributes.Clear();
         foreach (var ca in newModuleCustomAttributes)
         {
             modNode.Document.ModuleDef.CustomAttributes.Add(ca);
         }
     }
     resourceNodeCreator?.Add();
 }
예제 #2
0
        public void Execute()
        {
            bool refresh = false;

            for (int i = 0; i < newTypeNodeCreators.Length; i++)
            {
                newTypeNodeCreators[i].Add();
            }
            for (int i = 0; i < existingTypeNodeUpdaters.Length; i++)
            {
                existingTypeNodeUpdaters[i].Add();
            }
            if (!(origAssemblyDeclSecurities is null) && !(newAssemblyDeclSecurities is null))
            {
                modNode.Document.AssemblyDef !.DeclSecurities.Clear();
                foreach (var ds in newAssemblyDeclSecurities)
                {
                    modNode.Document.AssemblyDef.DeclSecurities.Add(ds);
                }
            }
            if (!(origAssemblyCustomAttributes is null) && !(newAssemblyCustomAttributes is null))
            {
                modNode.Document.AssemblyDef !.CustomAttributes.Clear();
                foreach (var ca in newAssemblyCustomAttributes)
                {
                    modNode.Document.AssemblyDef.CustomAttributes.Add(ca);
                }
            }
            if (!(origModuleCustomAttributes is null) && !(newModuleCustomAttributes is null))
            {
                modNode.Document.ModuleDef !.CustomAttributes.Clear();
                foreach (var ca in newModuleCustomAttributes)
                {
                    modNode.Document.ModuleDef.CustomAttributes.Add(ca);
                }
            }
            if (!(origExportedTypes is null) && !(newExportedTypes is null))
            {
                modNode.Document.ModuleDef !.ExportedTypes.Clear();
                foreach (var et in newExportedTypes)
                {
                    modNode.Document.ModuleDef.ExportedTypes.Add(et);
                }
            }
            if (!(newAssemblyVersion is null) && !(origAssemblyVersion is null))
            {
                modNode.Document.AssemblyDef !.Version = newAssemblyVersion;
                refresh = true;
            }
            resourceNodeCreator?.Add();
            if (refresh)
            {
                asmNode?.TreeNode.RefreshUI();
            }
        }
예제 #3
0
 public void Execute()
 {
     for (int i = 0; i < newTypeNodeCreators.Length; i++)
     {
         newTypeNodeCreators[i].Add();
     }
     for (int i = 0; i < existingTypeNodeUpdaters.Length; i++)
     {
         existingTypeNodeUpdaters[i].Add();
     }
     if (origAssemblyDeclSecurities != null && newAssemblyDeclSecurities != null)
     {
         modNode.Document.AssemblyDef.DeclSecurities.Clear();
         foreach (var ds in newAssemblyDeclSecurities)
         {
             modNode.Document.AssemblyDef.DeclSecurities.Add(ds);
         }
     }
     if (origAssemblyCustomAttributes != null && newAssemblyCustomAttributes != null)
     {
         modNode.Document.AssemblyDef.CustomAttributes.Clear();
         foreach (var ca in newAssemblyCustomAttributes)
         {
             modNode.Document.AssemblyDef.CustomAttributes.Add(ca);
         }
     }
     if (origModuleCustomAttributes != null && newModuleCustomAttributes != null)
     {
         modNode.Document.ModuleDef.CustomAttributes.Clear();
         foreach (var ca in newModuleCustomAttributes)
         {
             modNode.Document.ModuleDef.CustomAttributes.Add(ca);
         }
     }
     if (newAssemblyVersion != null && origAssemblyVersion != null)
     {
         modNode.Document.AssemblyDef.Version = newAssemblyVersion;
         asmNode?.TreeNode.RefreshUI();
     }
     resourceNodeCreator?.Add();
 }