Skip to content

Commit

Permalink
remove Ad library dependencies because we don't need them anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
duchuule committed Aug 29, 2018
1 parent 81da7fa commit 643d365
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 110 deletions.
20 changes: 2 additions & 18 deletions AdControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:VBA10"
xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
xmlns:adduplex="using:AdDuplex"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand All @@ -26,25 +25,10 @@
<!--<adduplex:AdControl x:Name="AdDuplexAdControl"
AppKey="53f0124b-fa9c-40be-a364-4589d505adcd"
AdUnitId="166555"
VerticalAlignment="Bottom"
VerticalContentAlignment="Bottom"
IsEnabled="False"
Visibility="Visible"
RefreshInterval="20"
RefreshInterval="20"
/>-->

<UI:AdControl ApplicationId="90156e70-3263-4775-8d1e-918443468f13"
AdUnitId="11532490"
Height="50"
Width="320"
VerticalAlignment="Bottom"
x:Name="MSAdControl"
ErrorOccurred="MSAdControl_ErrorOccurred"
AdRefreshed="MSAdControl_AdRefreshed"
AutoRefreshIntervalInSeconds="30"
Visibility="Visible"
>
</UI:AdControl>




Expand Down
74 changes: 37 additions & 37 deletions AdControl.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ 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;
using namespace Windows::UI::Core;
//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;
//using namespace Windows::UI::Core;


// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
Expand All @@ -31,36 +31,36 @@ AdControl::AdControl()
}


void AdControl::MSAdControl_ErrorOccurred(Platform::Object^ sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs^ e)
{
this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
{
MSAdControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
AdDuplex::AdControl^ AdDuplexAdControl = ref new AdDuplex::AdControl();
AdDuplexAdControl->AdUnitId = "166555";
AdDuplexAdControl->AppKey = "53f0124b-fa9c-40be-a364-4589d505adcd";
AdDuplexAdControl->IsTest = false;
adGrid->Children->Append(AdDuplexAdControl);

}));
}
//void AdControl::MSAdControl_ErrorOccurred(Platform::Object^ sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs^ e)
//{
// this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
// {
// MSAdControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
// AdDuplex::AdControl^ AdDuplexAdControl = ref new AdDuplex::AdControl();
// AdDuplexAdControl->AdUnitId = "166555";
// AdDuplexAdControl->AppKey = "53f0124b-fa9c-40be-a364-4589d505adcd";
// AdDuplexAdControl->IsTest = false;
// adGrid->Children->Append(AdDuplexAdControl);
//
// }));
//}


void AdControl::MSAdControl_AdRefreshed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
{

MSAdControl->Visibility = Windows::UI::Xaml::Visibility::Visible;

//AdDuplexAdControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
//AdDuplexAdControl->IsEnabled = false; //set to false to stop checking for ad
}));
}
//void AdControl::MSAdControl_AdRefreshed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
//{
// this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
// {
//
// MSAdControl->Visibility = Windows::UI::Xaml::Visibility::Visible;
//
// //AdDuplexAdControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
// //AdDuplexAdControl->IsEnabled = false; //set to false to stop checking for ad
// }));
//}


void AdControl::AdDuplexAdControl_AdCovered(Platform::Object^ sender, AdDuplex::Banners::Core::AdCoveredEventArgs^ e)
{
String^ test = e->CulpritElement->GetType()->FullName;
String^ test2 = e->CulpritElement->Name;
}
//void AdControl::AdDuplexAdControl_AdCovered(Platform::Object^ sender, AdDuplex::Banners::Core::AdCoveredEventArgs^ e)
//{
// String^ test = e->CulpritElement->GetType()->FullName;
// String^ test2 = e->CulpritElement->Name;
//}
6 changes: 3 additions & 3 deletions AdControl.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace VBA10
public:
AdControl();
private:
void MSAdControl_ErrorOccurred(Platform::Object^ sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs^ e);
void MSAdControl_AdRefreshed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void AdDuplexAdControl_AdCovered(Platform::Object^ sender, AdDuplex::Banners::Core::AdCoveredEventArgs^ e);
//void MSAdControl_ErrorOccurred(Platform::Object^ sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs^ e);
//void MSAdControl_AdRefreshed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
//void AdDuplexAdControl_AdCovered(Platform::Object^ sender, AdDuplex::Banners::Core::AdCoveredEventArgs^ e);
};
}
2 changes: 1 addition & 1 deletion Package.StoreAssociation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,5 @@
<MainPackageIdentityName>16994Sparksoft.VBA8</MainPackageIdentityName>
<MainPackageIdentityName>16994Sparksoft.VGBC8</MainPackageIdentityName>
</AccountPackageIdentityNames>
<PackageInfoList LandingUrl="https://dev.windows.com/dashboard/Application?appId=9NBLGGH2K04V" />
<PackageInfoList LandingUrl="https://developer.microsoft.com/dashboard/Application?appId=9NBLGGH2K04V" />
</StoreAssociation>
2 changes: 1 addition & 1 deletion Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="16994Sparksoft.VBA10" Publisher="CN=Wp8Emu" Version="1.22.197.0" />
<Identity Name="16994Sparksoft.VBA10" Publisher="CN=9289A21E-3389-49E2-A9E0-46AA1289C3CB" Version="1.22.199.0" />
<mp:PhoneIdentity PhoneProductId="2b9558e5-6253-426c-8989-3284f508e743" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>VBA10</DisplayName>
Expand Down
4 changes: 2 additions & 2 deletions SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
HorizontalAlignment="Stretch"
/>

<Button x:Name="watchVideoBtn" Content="**Watch Video"
<!--<Button x:Name="watchVideoBtn" Content="**Watch Video"
Click="watchVideobtn_Click"
x:Uid="WatchVideoBtn"
HorizontalAlignment="Stretch"
Grid.Column="2"/>
Grid.Column="2"/>-->


</Grid>
Expand Down
76 changes: 38 additions & 38 deletions SettingsPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace Windows::Globalization;
using namespace Windows::UI::ViewManagement;
using namespace Windows::Devices::Enumeration;
using namespace Windows::Devices::HumanInterfaceDevice;
using namespace Microsoft::Advertising::WinRT::UI;
//using namespace Microsoft::Advertising::WinRT::UI;
using namespace Windows::ApplicationModel::Resources;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
Expand Down Expand Up @@ -216,43 +216,43 @@ void SettingsPage::purchaseBtn_Click(Platform::Object^ sender, Windows::UI::Xaml
DirectXPage::Current->GoToPage(4);
}

void SettingsPage::watchVideobtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
//reset xbox controller timer



this->MyVideoAd = ref new InterstitialAd();

MyVideoAd->AdReady += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &SettingsPage::OnAdReady);
MyVideoAd->ErrorOccurred += ref new Windows::Foundation::EventHandler<Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^>(this, &VBA10::SettingsPage::OnErrorOccurred);
MyVideoAd->Cancelled += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &VBA10::SettingsPage::OnCancelled);
MyVideoAd->Completed += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &VBA10::SettingsPage::OnCompleted);
//MyVideoAd->RequestAd(AdType::Video, "90156e70-3263-4775-8d1e-918443468f13", "11533084"); //mobile
MyVideoAd->RequestAd(AdType::Video, "c6ee4c5e-e2b6-4b79-99e6-672f765f0ae0", "11533083"); //PC/tablet
//MyVideoAd->RequestAd(AdType::Video, "d25517cb-12d4-4699-8bdc-52040c712cab", "11389925"); //TEST MODE


}

void SettingsPage::OnAdReady(Platform::Object ^sender, Platform::Object ^args)
{
if (InterstitialAdState::Ready == MyVideoAd->State)
{
MyVideoAd->Show();


}

}

void SettingsPage::OnErrorOccurred(Platform::Object ^sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^args)
{
this->emulator->ResetXboxTimer();
this->runBuyNotice->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Black);
MessageDialog ^dialog = ref new MessageDialog(ResourceLoader::GetForViewIndependentUse()->GetString("ThanksWatchVideoText"));
dialog->ShowAsync();
}
//void SettingsPage::watchVideobtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
//{
// //reset xbox controller timer
//
//
//
// this->MyVideoAd = ref new InterstitialAd();
//
// MyVideoAd->AdReady += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &SettingsPage::OnAdReady);
// MyVideoAd->ErrorOccurred += ref new Windows::Foundation::EventHandler<Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^>(this, &VBA10::SettingsPage::OnErrorOccurred);
// MyVideoAd->Cancelled += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &VBA10::SettingsPage::OnCancelled);
// MyVideoAd->Completed += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &VBA10::SettingsPage::OnCompleted);
// //MyVideoAd->RequestAd(AdType::Video, "90156e70-3263-4775-8d1e-918443468f13", "11533084"); //mobile
// MyVideoAd->RequestAd(AdType::Video, "c6ee4c5e-e2b6-4b79-99e6-672f765f0ae0", "11533083"); //PC/tablet
// //MyVideoAd->RequestAd(AdType::Video, "d25517cb-12d4-4699-8bdc-52040c712cab", "11389925"); //TEST MODE
//
//
//}
//
//void SettingsPage::OnAdReady(Platform::Object ^sender, Platform::Object ^args)
//{
// if (InterstitialAdState::Ready == MyVideoAd->State)
// {
// MyVideoAd->Show();
//
//
// }
//
//}
//
//void SettingsPage::OnErrorOccurred(Platform::Object ^sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^args)
//{
// this->emulator->ResetXboxTimer();
// this->runBuyNotice->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Black);
// MessageDialog ^dialog = ref new MessageDialog(ResourceLoader::GetForViewIndependentUse()->GetString("ThanksWatchVideoText"));
// dialog->ShowAsync();
//}


void SettingsPage::OnCancelled(Platform::Object ^sender, Platform::Object ^args)
Expand Down
8 changes: 4 additions & 4 deletions SettingsPage.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ namespace VBA10
EmulatorGame *emulator;
bool initdone;
Platform::Collections::Vector<Windows::Devices::Enumeration::DeviceInformation^>^ HIDDeviceList;
Microsoft::Advertising::WinRT::UI::InterstitialAd^ MyVideoAd;
//Microsoft::Advertising::WinRT::UI::InterstitialAd^ MyVideoAd;

//input
void ConfigureBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void watchVideobtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
//void watchVideobtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void UpdateTextBox(Windows::UI::Xaml::Controls::TextBox ^box, VirtualKey vk);
void touchToggle_Toggled(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void keyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
Expand Down Expand Up @@ -73,8 +73,8 @@ namespace VBA10
void purchaseBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);


void OnAdReady(Platform::Object ^sender, Platform::Object ^args);
void OnErrorOccurred(Platform::Object ^sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^args);
//void OnAdReady(Platform::Object ^sender, Platform::Object ^args);
//void OnErrorOccurred(Platform::Object ^sender, Microsoft::Advertising::WinRT::UI::AdErrorEventArgs ^args);
void OnCancelled(Platform::Object ^sender, Platform::Object ^args);
void OnCompleted(Platform::Object ^sender, Platform::Object ^args);
void cboTheme_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
Expand Down
6 changes: 2 additions & 4 deletions VBA10.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>VBA10_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateKeyFile>VBA10_StoreKey.pfx</PackageCertificateKeyFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppxPackageDir>D:\Duc\Documents\Visual Studio 2015\Projects\VBA10\AppPackages\</AppxPackageDir>
<PackageCertificateThumbprint>848A58A80420B0058E01C68EF3AFF76DC6C329CF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>91DAD9BEFF797214BE31B3D92D5DBECB33EDF581</PackageCertificateThumbprint>
<AppxBundle>Always</AppxBundle>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -1530,8 +1530,6 @@
</FxCompile>
</ItemGroup>
<ItemGroup>
<SDKReference Include="AdDuplex.Windows10, Version=10.1.1.0" />
<SDKReference Include="Microsoft.Advertising.Xaml, Version=10.0" />
<SDKReference Include="SQLite.UWP.2015, Version=3.18.0" />
<SDKReference Include="WindowsMobile, Version=10.0.10240.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions VBA10.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@
</None>
<None Include="Package.StoreAssociation.xml" />
<None Include="packages.config" />
<None Include="VBA10_StoreKey.pfx" />
<None Include="VBA10_TemporaryKey.pfx" />
<None Include="Filter\hqx.inc">
<Filter>Filters</Filter>
</None>
<None Include="VBA10_TemporaryKey.pfx" />
<None Include="VBA10_StoreKey.pfx" />
</ItemGroup>
<ItemGroup>
<Page Include="DirectXPage.xaml" />
Expand Down
Binary file modified VBA10_StoreKey.pfx
Binary file not shown.
Binary file modified VBA10_TemporaryKey.pfx
Binary file not shown.

0 comments on commit 643d365

Please sign in to comment.