blob: 4bf4f89562e80c27507e13ac912a643bb339ca46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}
}
}
}
|