//public static int PUB_ID = 0; //public static int ADSPACE_ID = 0; public static void startAd(SomaAdViewer somaAdViewer) { somaAdViewer.Pub = PUB_ID; // Developer pub ID for testing somaAdViewer.Adspace = ADSPACE_ID; // Developer adSpace ID for testing somaAdViewer.AdInterval = 60; somaAdViewer.StartAds(); }
public override UIElement CreateControl() { base.CreateControl(); _control = new SomaAdViewer() { Name = "smaatoSystem", Width = this.Width, Height = this.Height, Adspace = this.AdSpaceID, Pub = this.PublisherID, PopupAd = false }; (_control as SomaAdViewer).AdError += SmaatoSystem_AdError; (_control as SomaAdViewer).NewAdAvailable += SmaatoSystem_NewAdAvailable; return _control; }
public AdControl() { var ad = new SomaAdViewer { #if DEBUG ShowErrors = true, #endif Pub = 923838645, Adspace = 65773647, LocationUseOK = true }; Content = ad; #if DEBUG if (DesignerProperties.IsInDesignTool) return; #else ad.AdError += (sender, code, description) => ad.Visibility = Visibility.Collapsed; ad.NewAdAvailable += (sender, args) => ad.Visibility = Visibility.Visible; #endif ad.Loaded += (sender, args) => ad.StartAds(); ad.Unloaded += (sender, args) => ad.StopAds(); }
public static void stopAd(SomaAdViewer somaAdViewer) { somaAdViewer.StopAds(); }