private PresentFromRootViewController ( global rootViewController ) : void | ||
rootViewController | global | |
return | void |
public virtual void PresentFromRootViewController (global::MonoTouch.UIKit.UIViewController rootViewController)
{
if (rootViewController == null)
throw new ArgumentNullException ("rootViewController");
if (IsDirectBinding) {
MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selPresentFromRootViewController_Handle, rootViewController.Handle);
} else {
MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selPresentFromRootViewController_Handle, rootViewController.Handle);
}
}
public void Show(string adUnit) { _adInterstitial = new GADInterstitial(adUnit); var request = GADRequest.Request; _adInterstitial.AdReceived += (sender, args) => { if (_adInterstitial.IsReady) { var window = UIApplication.SharedApplication.KeyWindow; var vc = window.RootViewController; while (vc.PresentedViewController != null) { vc = vc.PresentedViewController; } _adInterstitial.PresentFromRootViewController(vc); } }; _adInterstitial.LoadRequest(request); }