summaryrefslogtreecommitdiff
path: root/BCT
diff options
context:
space:
mode:
authorGravatar t-espave <unknown>2011-08-19 14:37:12 -0700
committerGravatar t-espave <unknown>2011-08-19 14:37:12 -0700
commit344a2dbc0744f14b087e3fa073147f5d81a2e40d (patch)
treeb4e3146e36ee4fef94e9cd6a1336574de46e0948 /BCT
parentc6f21632149c09d638fb376550b378c0c0194d59 (diff)
(phone bct) minor bugfixes found playing around with apps
Diffstat (limited to 'BCT')
-rw-r--r--BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs10
-rw-r--r--BCT/BytecodeTranslator/Phone/PhoneInitializationTraverser.cs12
-rw-r--r--BCT/BytecodeTranslator/TranslationHelper.cs4
-rw-r--r--BCT/PhoneControlsExtractor/PhoneControlsExtractor.py2
4 files changed, 26 insertions, 2 deletions
diff --git a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
index 18107ac2..98727b1e 100644
--- a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
+++ b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
@@ -30,7 +30,12 @@ namespace BytecodeTranslator.Phone {
string str = realUri.GetComponents(UriComponents.Path | UriComponents.StrongAuthority | UriComponents.Scheme, UriFormat.UriEscaped);
Uri mockStrippedUri = new Uri(str);
- return mockBaseUri.MakeRelativeUri(mockStrippedUri).ToString();
+ /*
+ Uri relativeUri = mockBaseUri.MakeRelativeUri(mockStrippedUri);
+ return relativeUri.ToString();
+ */
+ // TODO PATCH this works for now because we are ignoring non-flat XAML structures
+ return mockStrippedUri.Segments.Last();
}
/// <summary>
@@ -404,6 +409,9 @@ namespace BytecodeTranslator.Phone {
ITypeReference appBarIconButtonType = platform.CreateReference(phoneAssembly, "Microsoft", "Phone", "Shell", "ApplicationBarIconButton");
PHONE_UI_CHANGER_METHODS[appBarIconButtonType.ToString()] = new string[] { "set_IsEnabled", "set_IconUri", "set_Text", };
+ ITypeReference appBarMenuItemType = platform.CreateReference(phoneAssembly, "Microsoft", "Phone", "Shell", "ApplicationBarMenuItem");
+ PHONE_UI_CHANGER_METHODS[appBarMenuItemType.ToString()] = new string[] { "set_IsEnabled", "set_Text", };
+
ITypeReference emailComposeTaskType = platform.CreateReference(phoneAssembly, "Microsoft", "Phone", "Tasks", "EmailComposeTask");
PHONE_UI_CHANGER_METHODS[emailComposeTaskType.ToString()] = new string[] { "Show", };
diff --git a/BCT/BytecodeTranslator/Phone/PhoneInitializationTraverser.cs b/BCT/BytecodeTranslator/Phone/PhoneInitializationTraverser.cs
index 5ca8f66a..391aaaaa 100644
--- a/BCT/BytecodeTranslator/Phone/PhoneInitializationTraverser.cs
+++ b/BCT/BytecodeTranslator/Phone/PhoneInitializationTraverser.cs
@@ -33,6 +33,7 @@ namespace BytecodeTranslator.Phone {
private IAssemblyReference phoneSystemWindowsAssembly;
private IAssemblyReference MSPhoneControlsAssembly;
private INamespaceTypeReference appBarIconButtonType;
+ private INamespaceTypeReference appBarMenuItemType;
private INamespaceTypeReference checkBoxType;
private INamespaceTypeReference radioButtonType;
private INamespaceTypeReference buttonType;
@@ -41,6 +42,7 @@ namespace BytecodeTranslator.Phone {
private INamespaceTypeReference controlType;
private INamespaceTypeReference uiElementType;
private INamespaceTypeReference pivotType;
+ private INamespaceTypeReference listBoxType;
private CompileTimeConstant trueConstant;
private CompileTimeConstant falseConstant;
@@ -67,8 +69,12 @@ namespace BytecodeTranslator.Phone {
return checkBoxType;
} else if (classname == "ApplicationBarIconButton") {
return appBarIconButtonType;
+ } else if (classname == "ApplicationBarMenuItem") {
+ return appBarMenuItemType;
} else if (classname == "Pivot") {
return pivotType;
+ } else if (classname == "ListBox") {
+ return listBoxType;
} else if (classname == "DummyType") {
// return Dummy.Type;
return host.PlatformType.SystemObject;
@@ -108,8 +114,10 @@ namespace BytecodeTranslator.Phone {
// TODO determine the needed types dynamically
if (phoneAssembly != Dummy.Assembly) {
appBarIconButtonType = platform.CreateReference(phoneAssembly, "Microsoft", "Phone", "Shell", "ApplicationBarIconButton");
+ appBarMenuItemType = platform.CreateReference(phoneAssembly, "Microsoft", "Phone", "Shell", "ApplicationBarMenuItem");
} else {
appBarIconButtonType = host.PlatformType.SystemObject;
+ appBarMenuItemType = host.PlatformType.SystemObject;
}
if (phoneSystemWindowsAssembly != Dummy.Assembly) {
@@ -120,6 +128,7 @@ namespace BytecodeTranslator.Phone {
toggleButtonType = platform.CreateReference(phoneSystemWindowsAssembly, "System", "Windows", "Controls", "Primitives", "ToggleButton");
controlType = platform.CreateReference(phoneSystemWindowsAssembly, "System", "Windows", "Controls", "Control");
uiElementType = platform.CreateReference(phoneSystemWindowsAssembly, "System", "Windows", "UIElement");
+ listBoxType = platform.CreateReference(phoneSystemWindowsAssembly, "System", "Windows", "Controls", "ListBox");
} else {
checkBoxType = host.PlatformType.SystemObject;
radioButtonType = host.PlatformType.SystemObject;
@@ -128,6 +137,7 @@ namespace BytecodeTranslator.Phone {
toggleButtonType = host.PlatformType.SystemObject;
controlType = host.PlatformType.SystemObject;
uiElementType = host.PlatformType.SystemObject;
+ listBoxType = host.PlatformType.SystemObject;
}
if (MSPhoneControlsAssembly != Dummy.Assembly) {
@@ -136,6 +146,8 @@ namespace BytecodeTranslator.Phone {
pivotType = host.PlatformType.SystemObject;
}
+
+
trueConstant = new CompileTimeConstant() {
Type = platform.SystemBoolean,
Value = true
diff --git a/BCT/BytecodeTranslator/TranslationHelper.cs b/BCT/BytecodeTranslator/TranslationHelper.cs
index 252ea483..ce59f749 100644
--- a/BCT/BytecodeTranslator/TranslationHelper.cs
+++ b/BCT/BytecodeTranslator/TranslationHelper.cs
@@ -166,6 +166,10 @@ namespace BytecodeTranslator {
s = s.Replace('|', '$');
s = s.Replace('+', '$');
s = s.Replace('’', '$');
+ s= s.Replace('€', '$');
+ s = s.Replace('•', '$');
+ s = s.Replace('£', '$');
+ s = s.Replace('¥', '$');
s = GetRidOfSurrogateCharacters(s);
return s;
}
diff --git a/BCT/PhoneControlsExtractor/PhoneControlsExtractor.py b/BCT/PhoneControlsExtractor/PhoneControlsExtractor.py
index 8a384e09..e119cab8 100644
--- a/BCT/PhoneControlsExtractor/PhoneControlsExtractor.py
+++ b/BCT/PhoneControlsExtractor/PhoneControlsExtractor.py
@@ -4,7 +4,7 @@ import os
from xml.dom import minidom
import xml.dom
-CONTROL_NAMES= ["Button", "CheckBox", "RadioButton", "ApplicationBarIconButton", "Pivot"]
+CONTROL_NAMES= ["Button", "CheckBox", "RadioButton", "ApplicationBarIconButton", "ApplicationBarMenuItem", "Pivot", "ListBox"]
# TODO maybe a control is enabled but its parent is not, must take this into account
# TODO a possible solution is to tie the enabled value to that of the parent in the app until it is either overriden