Пример #1
0
        private HashSet <string> GetActivitiesWithMetadata(AndroidManifest doc, string name, string val)
        {
            HashSet <string> set        = new HashSet <string>();
            IEnumerator      enumerator = doc.GetElementsByTagName("meta-data").GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    XmlElement current    = (XmlElement)enumerator.Current;
                    XmlElement parentNode = (XmlElement)current.ParentNode;
                    if (((parentNode != null) && (parentNode.LocalName == "activity")) && ((current.GetAttribute("android:name") == name) && (current.GetAttribute("android:value") == val)))
                    {
                        set.Add(parentNode.GetAttribute("android:name"));
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            return(set);
        }
Пример #2
0
 private HashSet<string> GetActivitiesWithMetadata(AndroidManifest doc, string name, string val)
 {
     HashSet<string> set = new HashSet<string>();
     IEnumerator enumerator = doc.GetElementsByTagName("meta-data").GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             XmlElement current = (XmlElement) enumerator.Current;
             XmlElement parentNode = (XmlElement) current.ParentNode;
             if (((parentNode != null) && (parentNode.LocalName == "activity")) && ((current.GetAttribute("android:name") == name) && (current.GetAttribute("android:value") == val)))
             {
                 set.Add(parentNode.GetAttribute("android:name"));
             }
         }
     }
     finally
     {
         IDisposable disposable = enumerator as IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
     return set;
 }