summaryrefslogtreecommitdiff
path: root/cpp/test/uwp/controller/ViewController.xaml.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-12-22 22:12:49 +0100
committerJose <jose@zeroc.com>2016-12-22 22:12:49 +0100
commitd8a1bead23b352b7b2a5ccaa3a94c7ca0de5d0b5 (patch)
tree066d8e2809d065fb0ad2be6ab6ebd2c0013326ff /cpp/test/uwp/controller/ViewController.xaml.cpp
parentRegenerate UWP controller certificate without password (diff)
downloadice-d8a1bead23b352b7b2a5ccaa3a94c7ca0de5d0b5.tar.bz2
ice-d8a1bead23b352b7b2a5ccaa3a94c7ca0de5d0b5.tar.xz
ice-d8a1bead23b352b7b2a5ccaa3a94c7ca0de5d0b5.zip
UWP controller fixes
- Scroll output to end after append new line - Remove Hostname combobox as was not used - Update cert hash in project file
Diffstat (limited to 'cpp/test/uwp/controller/ViewController.xaml.cpp')
-rw-r--r--cpp/test/uwp/controller/ViewController.xaml.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/cpp/test/uwp/controller/ViewController.xaml.cpp b/cpp/test/uwp/controller/ViewController.xaml.cpp
index 308e84ed431..af911053842 100644
--- a/cpp/test/uwp/controller/ViewController.xaml.cpp
+++ b/cpp/test/uwp/controller/ViewController.xaml.cpp
@@ -115,7 +115,7 @@ class ControllerHelper
{
public:
- ControllerHelper(ViewController^, string);
+ ControllerHelper(ViewController^);
virtual ~ControllerHelper();
void
@@ -340,12 +340,12 @@ ProcessControllerI::getHost(string, bool, const Ice::Current&)
return _hostname;
}
-ControllerHelper::ControllerHelper(ViewController^ controller, string hostname)
+ControllerHelper::ControllerHelper(ViewController^ controller)
{
Ice::InitializationData initData = Ice::InitializationData();
initData.properties = Ice::createProperties();
initData.properties->setProperty("Ice.ThreadPool.Server.SizeMax", "10");
- initData.properties->setProperty("Ice.Default.Host", hostname);
+ initData.properties->setProperty("Ice.Default.Host", "127.0.0.1");
//initData.properties->setProperty("Ice.Trace.Network", "3");
//initData.properties->setProperty("Ice.Trace.Protocol", "1");
initData.properties->setProperty("ControllerAdapter.AdapterId", Ice::generateUUID());
@@ -357,7 +357,7 @@ ControllerHelper::ControllerHelper(ViewController^ controller, string hostname)
Ice::ObjectAdapterPtr adapter = _communicator->createObjectAdapterWithEndpoints("ControllerAdapter", "");
Ice::Identity ident = { "ProcessController", "UWP"};
auto processController = Ice::uncheckedCast<ProcessControllerPrx>(
- adapter->add(make_shared<ProcessControllerI>(controller, hostname), ident));
+ adapter->add(make_shared<ProcessControllerI>(controller, "127.0.0.1"), ident));
adapter->activate();
registerProcessController(controller, adapter, registry, processController);
@@ -417,29 +417,12 @@ ViewController::ViewController()
void
ViewController::OnNavigatedTo(NavigationEventArgs^)
{
- Hostname->Items->Clear();
- Hostname->Items->Append(L"127.0.0.1");
- for(auto i : NetworkInformation::GetHostNames())
- {
- if(i->IPInformation != nullptr && i->IPInformation->NetworkAdapter != nullptr)
- {
- Hostname->Items->Append(i->CanonicalName);
- }
- }
- Hostname->SelectedIndex = 0;
-}
-
-
-void
-ViewController::Hostname_SelectionChanged(Platform::Object^ sender, SelectionChangedEventArgs^ e)
-{
- String^ hostname = Hostname->SelectedItem->ToString();
if(controllerHelper)
{
delete controllerHelper;
controllerHelper = 0;
}
- controllerHelper = new ControllerHelper(this, Ice::wstringToString(hostname->Data()));
+ controllerHelper = new ControllerHelper(this);
}
void
@@ -449,6 +432,8 @@ ViewController::println(const string& s)
[=]()
{
Output->Items->Append(ref new String(Ice::stringToWstring(s).c_str()));
+ Output->SelectedIndex = Output->Items->Size - 1;
+ Output->ScrollIntoView(Output->SelectedItem);
}));
}