-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathHelpPage.xaml.cpp
78 lines (62 loc) · 2.29 KB
/
HelpPage.xaml.cpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// HelpPage.xaml.cpp
// Implementation of the HelpPage class
//
#include "pch.h"
#include "App.xaml.h"
#include "HelpPage.xaml.h"
#include <ppltasks.h>
#include "AdControl.xaml.h"
using namespace VBA10;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
HelpPage::HelpPage()
{
InitializeComponent();
//create ad control
if (App::HasAds)
{
AdControl^ adControl = ref new AdControl();
LayoutRoot->Children->Append(adControl);
adControl->SetValue(Grid::RowProperty, 2);
}
//get version
auto myPackage = Windows::ApplicationModel::Package::Current;
auto version = myPackage->Id->Version;
auto loader = Windows::ApplicationModel::Resources::ResourceLoader::GetForViewIndependentUse();
versionBlock->Text = loader->GetString("VersionText") + version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
}
void HelpPage::gplButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
Windows::System::Launcher::LaunchUriAsync(ref new Windows::Foundation::Uri("http://www.gnu.org/licenses/gpl-3.0.txt"));
}
//void HelpPage::sourceButton_Tapped(Platform::Object^ sender, Windows::UI::Xaml::TappedRoutedEventArgs^ e)
//{
// Windows::System::Launcher::LaunchUriAsync(ref new Windows::Foundation::Uri("http://sdrv.ms/10ehg2a"));
//}
void HelpPage::contactBlock_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
{
auto uri = ref new Windows::Foundation::Uri("mailto:[email protected]?subject=VBA10 bug report or feature suggestion&body=");
// Launch the URI
concurrency::task<bool> launchUriOperation(Windows::System::Launcher::LaunchUriAsync(uri));
launchUriOperation.then([](bool success)
{
if (success)
{
// URI launched
}
else
{
// URI launch failed
}
});
}