Пример #1
0
        void GetExpressionRefs(AbcFile abc)
        {
            //TODO: namespace refs
            int n = abc.Multinames.Count;

            for (int i = 1; i < n; ++i)
            {
                var mn = abc.Multinames[i];
                if (mn.IsRuntime)
                {
                    continue;
                }

                foreach (var fullName in mn.GetFullNames())
                {
                    if (string.IsNullOrEmpty(fullName))
                    {
                        continue;
                    }
                    var type = _app.FindInstance(fullName);
                    if (type != null)
                    {
                        if (type.IsNative)
                        {
                            continue;
                        }
                        Add(type.Name, SwcCatalog.DepTypes.Expression);
                    }
                }
            }
        }
Пример #2
0
        static void DumpInstance(IEnumerable <AbcFile> list, string instanceName, string path, bool fullHierarchy)
        {
            var instance = AbcFile.FindInstance(list, instanceName);

            if (instance != null)
            {
                if (fullHierarchy)
                {
                    string xmlpath = MakeInstanceDumpPath(instance, path);
                    using (var writer = Utils.CreateXmlWriter(xmlpath))
                    {
                        writer.WriteStartDocument();
                        writer.WriteStartElement("abc");

                        while (true)
                        {
                            instance.DumpXml(writer);
                            var bn = instance.BaseTypeName;
                            if (bn == null)
                            {
                                break;
                            }
                            instanceName = bn.FullName;
                            instance     = AbcFile.FindInstance(list, instanceName);
                            if (instance == null)
                            {
                                break;
                            }
                        }

                        writer.WriteEndElement();
                        writer.WriteEndDocument();
                    }
                }
                else
                {
                    DumpInstance(instance, path);
                }
                return;
            }
            Console.WriteLine("Unable to find instance {0}", instanceName);
            return;
        }