diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-09-21 15:50:05 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-09-21 15:50:05 +0200 |
| commit | cc8e24461c625400143677956bdffb9268d8050b (patch) | |
| tree | 71cdae83f6b1e15ab99471fe3b1995fb907d5154 /StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs | |
| parent | c1bd61b6ad4b3d4d1cd2da81f6ec403565cc1f4b (diff) | |
analytics plugin
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs')
| -rw-r--r-- | StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs b/StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs new file mode 100644 index 00000000..4bf4f895 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-google-analytics/wp8/PhoneHelpers.cs @@ -0,0 +1,30 @@ +using System; +using System.Xml; + +namespace UniversalAnalyticsPlugin +{ + internal static class Helpers + { + public static string GetAppAttribute(string attributeName) + { + try + { + XmlReaderSettings xmlReaderSettings = new XmlReaderSettings(); + xmlReaderSettings.XmlResolver = new XmlXapResolver(); + using (XmlReader xmlReader = XmlReader.Create("WMAppManifest.xml", xmlReaderSettings)) + { + xmlReader.ReadToDescendant("App"); + if (!xmlReader.IsStartElement()) + { + throw new FormatException("WMAppManifest.xml is missing"); + } + return xmlReader.GetAttribute(attributeName); + } + } + catch + { + return null; + } + } + } +} |
