private static bool SearchForAnimationsInResources(DocumentCompositeNode elementNode, DocumentNode pathNameNode) { bool flag; DocumentCompositeNode resources = null; ISupportsResources resourcesCollection = ResourceNodeHelper.GetResourcesCollection(elementNode); if (resourcesCollection != null) { resources = resourcesCollection.Resources; } if (resources != null) { using (IEnumerator <DocumentNode> enumerator = resources.ChildNodes.GetEnumerator()) { while (enumerator.MoveNext()) { DocumentCompositeNode current = enumerator.Current as DocumentCompositeNode; if (current == null) { continue; } DocumentNode item = current.Properties[KnownProperties.DictionaryEntryValueProperty]; if (item == null || !PlatformTypes.Storyboard.IsAssignableFrom(item.Type)) { continue; } using (IEnumerator <DocumentNode> enumerator1 = item.FindPointAnimationDescendantNodes().GetEnumerator()) { while (enumerator1.MoveNext()) { if (!PathGeometrySerializationHelper.DoesAnimationTargetPath(pathNameNode, enumerator1.Current)) { continue; } flag = true; return(flag); } } } return(false); } return(flag); } return(false); }