WP8: Avoid config value
of a wrong element.
If you have an element that shares the `name`, like <feature name="SplashScreen">, then the `value` attribute was read of that instead (since it can appear *before* the preference element). Thus, the config of `SplashScreen` preference was not settable at all.
This commit is contained in:
parent
57ad3602f4
commit
ac23964ac6
@ -105,6 +105,7 @@ namespace WPCordovaClassLib.Cordova.Commands
|
|||||||
XDocument configFile = XDocument.Parse(sr.ReadToEnd());
|
XDocument configFile = XDocument.Parse(sr.ReadToEnd());
|
||||||
|
|
||||||
string configAutoHide = configFile.Descendants()
|
string configAutoHide = configFile.Descendants()
|
||||||
|
.Where(x => x.Name.LocalName == "preference")
|
||||||
.Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen")
|
.Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen")
|
||||||
.Select(x => (string)x.Attribute("value"))
|
.Select(x => (string)x.Attribute("value"))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@ -113,6 +114,7 @@ namespace WPCordovaClassLib.Cordova.Commands
|
|||||||
prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide;
|
prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide;
|
||||||
|
|
||||||
string configDelay = configFile.Descendants()
|
string configDelay = configFile.Descendants()
|
||||||
|
.Where(x => x.Name.LocalName == "preference")
|
||||||
.Where(x => (string)x.Attribute("name") == "SplashScreenDelay")
|
.Where(x => (string)x.Attribute("name") == "SplashScreenDelay")
|
||||||
.Select(x => (string)x.Attribute("value"))
|
.Select(x => (string)x.Attribute("value"))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@ -120,6 +122,7 @@ namespace WPCordovaClassLib.Cordova.Commands
|
|||||||
prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay;
|
prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay;
|
||||||
|
|
||||||
string configImage = configFile.Descendants()
|
string configImage = configFile.Descendants()
|
||||||
|
.Where(x => x.Name.LocalName == "preference")
|
||||||
.Where(x => (string)x.Attribute("name") == "SplashScreen")
|
.Where(x => (string)x.Attribute("name") == "SplashScreen")
|
||||||
.Select(x => (string)x.Attribute("value"))
|
.Select(x => (string)x.Attribute("value"))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user