Created
March 17, 2011 03:29
-
-
Save limitedmage/873780 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CreateAd() | |
{ | |
#if !DEBUG | |
AdControl.TestMode = false; | |
#endif | |
AdControl ad = new AdControl( | |
#if DEBUG | |
"test_client", | |
"Image480_80", | |
#else | |
"YOUR PUB CENTER APP ID HERE", | |
"YOUR PUB CENTER AD UNIT ID HERE", | |
#endif | |
AdModel.Contextual, | |
false | |
); | |
ad.Width = 480; | |
ad.Height = 80; | |
// AdContainer is some StackPanel in the page | |
AdContainer.Children.Add(ad); | |
this.Unloaded += (s, e) => | |
{ | |
if (AdContainer.Children.Contains(ad)) AdContainer.Children.Remove(ad); | |
ad = null; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment