ResolveGlobal() public méthode

public ResolveGlobal ( string moduleName, int ordinal, IPlatform platform ) : Identifier
moduleName string
ordinal int
platform IPlatform
Résultat Identifier
Exemple #1
0
        public void Impres_GlobalByName()
        {
            var proj = new Project
            {
                MetadataFiles =
                {
                    new MetadataFile
                    {
                         ModuleName = "foo"
                    }
                },
                Programs =
                {
                    program
                }
            };

            var module = new ModuleDescriptor("foo")
            {
                GlobalsByName =
                {
                    {
                         "bar",
                         new StructureType
                         {
                             Fields =
                             {
                                 { 0, new Pointer(PrimitiveType.Char, 4), "name" },
                                 { 4, PrimitiveType.Int32, "age" }
                             }
                         }
                    }
                }
            };
            program.EnvironmentMetadata.Modules.Add(module.ModuleName, module);

            var impres = new ImportResolver(proj, program, new FakeDecompilerEventListener());
            var dt = impres.ResolveGlobal("foo", "bar", platform);
            Assert.AreEqual("bar", dt.ToString());
        }