Friday, January 21, 2011

Windows Phone 7 Ad Control Testing in Emulator

I did the following after checking several posts on the Microsoft Ad Control for Windows Phone 7.
The following should go in the Constructor of the page.

 if (!CheckIsTrial())
{
SP_ADControl.Visibility = Visibility.Collapsed;

}
else
{
// Show_Buy_Now_Page();
SP_ADControl.Visibility = Visibility.Visible;
}



the following is the CheckisTrial Method



private bool CheckIsTrial()
{
#if DEBUG
MessageBoxResult result = MessageBox.Show("CLICK OK TO SIMULATE FULL LICENSE", "BUY NOW!", MessageBoxButton.OKCancel);


if (result == MessageBoxResult.OK)
{
return false;
}
else
{
return true;
}
#else
Return licenseInfo.IsTrial();
#endif
}

No comments:

Post a Comment