private void OnTextureDataDownload(System.Object sender, DownloadDataCompletedEventArgs e) { Logger.Log(this, "OnImageDownloaded: Entered"); if (e.Cancelled) { String errorMesage = "Image Load. Request Cancelled."; InternalAdLoadFailedArgs args = new InternalAdLoadFailedArgs(1, errorMesage); adListener.OnAdLoadFailed(args); //AnalyticsWebManager.Push(new AdEventDTO(this.adUnitId, AdEventDTO.EventType.AdResourceDownloadFailed, errorMesage), AnalyticsWebWrapperDTO.Action.AdEvent, AnalyticsWebManager.PRIORITY.HIGH); return; } if (e.Error != null) { String errorMessage = e.Error.Message; InternalAdLoadFailedArgs args = new InternalAdLoadFailedArgs(2, errorMessage); adListener.OnAdLoadFailed(args); //AnalyticsWebManager.Push(new AdEventDTO(this.adUnitId, AdEventDTO.EventType.AdResourceDownloadFailed, errorMessage), AnalyticsWebWrapperDTO.Action.AdEvent, AnalyticsWebManager.PRIORITY.HIGH); return; } byte[] data = e.Result; IPlatformObjectsFactory factory = PlatformObjectsFactoryHolder.GetFactory(); this.textureObject = factory.GetTextureObject(); bool result = this.textureObject.CreateTextureObject(data); if (!result) //client couldn't create the texture object { } adListener.OnAdLoaded(this); //AnalyticsWebManager.Push(new AdEventDTO(this.adUnitId, AdEventDTO.EventType.AdResourceDownloadSuccess, ""), AnalyticsWebWrapperDTO.Action.AdEvent, AnalyticsWebManager.PRIORITY.HIGH); }
public static void Startup(String appId) { if (!isStartupDone) { isStartupDone = true; AdConfigurer.SetAppId(appId); AdConfigurer.Startup(new PlatformPCWindowsImpl()); PlatformObjectsFactoryHolder.SetFactory(new PlatformObjectsFactoryUnity()); } }
public static void Main(string[] args) { Console.WriteLine("Hello World!"); AdConfigurer.Startup(new PlatformImpl()); PlatformVariableTest.Test1(); /*AdListenerImplementation adListenerImplementation = new AdListenerImplementation(); * ImageTextureAd adClient = new ImageTextureAd (adListenerImplementation, "asdfadfd"); * adClient.LoadAds (2); * //AnalyticsWebManagerTest.Test1();*/ PlatformObjectsFactoryHolder.SetFactory(new PlatformObjectsFactoryUnity()); AdListenerImplementation adListener = new AdListenerImplementation(); ImageTextureAdUnit adUnit = new ImageTextureAdUnit(adListener, "adsfd"); adUnit.LoadAds(2); SystemInfoTest.TestHardwareInfo(); //AnalyticsWebManagerTest.Test1(); AdConfigurer.Shutdown(); Console.ReadLine(); }