diff options
author | t-espave <unknown> | 2011-08-01 08:30:16 -0700 |
---|---|---|
committer | t-espave <unknown> | 2011-08-01 08:30:16 -0700 |
commit | ec7f410f07d149c1187a92080b0acda815ec3a75 (patch) | |
tree | 1e627b888600081599b061f9b3e03619ebfb35c9 /BCT/BytecodeTranslator/Phone | |
parent | 75b0b3ccd6b38aa4d03746e4f41d985ad32d2230 (diff) |
fix for exception when phoneControls are not set
Diffstat (limited to 'BCT/BytecodeTranslator/Phone')
-rw-r--r-- | BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs | 18 | ||||
-rw-r--r-- | BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs index 59e21a04..34eccf51 100644 --- a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs +++ b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs @@ -42,8 +42,12 @@ namespace BytecodeTranslator.Phone { }
}
- uri = constantStrings.Aggregate((aggr, elem) => aggr + elem);
- return Uri.IsWellFormedUriString(uri, UriKind.RelativeOrAbsolute);
+ if (constantStrings.Count > 0) {
+ uri = constantStrings.Aggregate((aggr, elem) => aggr + elem);
+ return Uri.IsWellFormedUriString(uri, UriKind.RelativeOrAbsolute);
+ } else {
+ return false;
+ }
}
}
@@ -169,6 +173,8 @@ namespace BytecodeTranslator.Phone { public bool OnBackKeyPressOverriden { get; set; }
public bool BackKeyPressHandlerCancels { get; set; }
public bool BackKeyPressNavigates { get; set; }
+ public ICollection<ITypeReference> BackKeyCancellingOffenders= new HashSet<ITypeReference>();
+ public ICollection<ITypeReference> BackKeyNavigatingOffenders= new HashSet<ITypeReference>();
private Dictionary<string, string[]> PHONE_UI_CHANGER_METHODS;
@@ -194,10 +200,10 @@ namespace BytecodeTranslator.Phone { }
private PhoneCodeHelper(IMetadataHost host) {
- if (host == null)
- throw new ArgumentNullException();
- platform = host.PlatformType as Microsoft.Cci.Immutable.PlatformType;
- initializeKnownUIChangers();
+ if (host != null) {
+ platform = host.PlatformType as Microsoft.Cci.Immutable.PlatformType;
+ initializeKnownUIChangers();
+ }
}
private void initializeKnownUIChangers() {
diff --git a/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs b/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs index b515e416..3141e61f 100644 --- a/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs +++ b/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs @@ -127,8 +127,10 @@ namespace BytecodeTranslator.Phone { public override void Visit(IMethodCall methodCall) {
if (isNavigationOnBackKeyPressHandler(methodCall)) {
PhoneCodeHelper.instance().BackKeyPressNavigates = true;
+ PhoneCodeHelper.instance().BackKeyNavigatingOffenders.Add(typeTraversed);
} else if (isCancelOnBackKeyPressHandler(methodCall)) {
PhoneCodeHelper.instance().BackKeyPressHandlerCancels = true;
+ PhoneCodeHelper.instance().BackKeyCancellingOffenders.Add(typeTraversed);
}
// check whether it is a NavigationService call
|