Exemplo n.º 1
0
 public void SetupBanner(IBanner banner)
 {
     m_Banner          = banner;
     m_BannersClass    = new AndroidJavaClass("com.unity3d.services.banners.UnityBanners");
     m_CurrentActivity = AndroidPlatform.GetCurrentAndroidActivity();
     m_BannerBundle    = null;
 }
Exemplo n.º 2
0
        public async Task <IBanner> Add(IBanner banner)
        {
            var doc = new BannerDoc();

            Mapper.Map(banner, doc);
            await _context.Banners.InsertOneAsync(doc);

            return(Mapper.Map <Banner>(doc));
        }
Exemplo n.º 3
0
        static Platform()
        {
            var fakeBanner = new GameObject("UnityAdsEditorFakeBanner")
            {
                hideFlags = HideFlags.HideAndDontSave | HideFlags.HideInInspector
            };

            s_Banner = fakeBanner.AddComponent <Banner>();
        }
Exemplo n.º 4
0
 public HomeController(ILogger <HomeController> logger,
                       IProductRepository productRepository,
                       ICategoryRepository categoryRepository,
                       IBanner bannerRepository)
 {
     _logger = logger;
     this.productRepository  = productRepository;
     this.categoryRepository = categoryRepository;
     this.bannerRepository   = bannerRepository;
 }
 public RunCalculator(IBanner banner,
                      IIsOddRule isOddRule,
                      IIsEvenCalculationRule isEvenCalculationRule,
                      ICheckIsOdd checkIsOdd)
 {
     _banner                = banner;
     _isOddRule             = isOddRule;
     _isEvenCalculationRule = isEvenCalculationRule;
     _checkIsOdd            = checkIsOdd;
 }
Exemplo n.º 6
0
 public BannerViewModel(IBanner ds)
 {
     _bannerDatasource = ds;
     Id       = ds.Id;
     Headline = ds.HeadLine;
     Title    = ds.Title;
     Sub      = ds.Sub;
     Img      = ds.Img;
     Content  = ds.Content;
     CTA      = ds.CTA;
 }
Exemplo n.º 7
0
        protected static void CheckEqual(IBanner banner, IBanner dbBanner)
        {
            Assert.Equal(banner.Id, dbBanner.Id);
            Assert.Equal(banner.Html, dbBanner.Html);

            Assert.True(banner.Created.Subtract(dbBanner.Created).TotalMilliseconds < 1);
            Assert.True(banner.Modified.HasValue && dbBanner.Modified.HasValue ||
                        !banner.Modified.HasValue && !dbBanner.Modified.HasValue);
            if (banner.Modified.HasValue)
            {
                Assert.True(banner.Modified.Value.Subtract(dbBanner.Modified.Value).TotalMilliseconds < 1);
            }
        }
Exemplo n.º 8
0
        static Platform()
        {
            _listeners = new HashSet <IUnityAdsListener>();
            var callbackExecutorGameObject = new GameObject("UnityAdsCallbackExecutorObject")
            {
                hideFlags = HideFlags.HideAndDontSave | HideFlags.HideInInspector
            };

            m_CallbackExecutor = callbackExecutorGameObject.AddComponent <CallbackExecutor>();
            Object.DontDestroyOnLoad(callbackExecutorGameObject);

            var fakeBanner = new GameObject("UnityAdsEditorFakeBanner")
            {
                hideFlags = HideFlags.HideAndDontSave | HideFlags.HideInInspector
            };

            s_Banner = fakeBanner.AddComponent <Banner>();
        }
Exemplo n.º 9
0
        public async Task <IBanner> Update(int id, IBanner banner)
        {
            var filter = Builders <BannerDoc> .Filter.Eq(nameof(BannerDoc.Id), id);

            var res = await _context.Banners.FindAsync(filter);

            var item = await res.FirstOrDefaultAsync();

            if (item == null)
            {
                return(null);
            }

            banner.Id = item.Id;
            Mapper.Map(banner, item);

            await _context.Banners.ReplaceOneAsync(filter, item);

            return(Mapper.Map <Banner>(item));
        }
Exemplo n.º 10
0
        public void InitAdsManager(AdSystem adSystem)
        {
            _system = adSystem;
            if (_system.IsNoAds.Value)
            {
                return;
            }
            // observe IsNoAds value,
            // whenever it's true (normally when the ads have just been removed),
            // we hide the banner
            _system.IsNoAds.Subscribe(flag => {
                if (flag)
                {
                    ShowBanner(false);
                }
            });

            _banner = GetComponent <IBanner>();
            Assert.Null(_banner, "cant find IBanner component in AdBannerManager");
            _banner.InitBanner(() => {
                _bannerLoaded = true;
                TryShowOrHideBanner();
            });
        }
Exemplo n.º 11
0
 /// <summary>Static getter for CTA Button Link</summary>
 public static string GetCTabuttonLink(IBanner that)
 {
     return(that.GetPropertyValue <string>("cTAButtonLink"));
 }
Exemplo n.º 12
0
 public BannerController(IBanner bannerRepositori)
 {
     this.bannerRepositori = bannerRepositori;
 }
Exemplo n.º 13
0
        void Awake()
        {
            var a = FindObjectsOfType <AdsManager>();

            if (a != null && a.Length > 1)
            {
                foreach (var ad in a)
                {
                    if (ad != this)
                    {
                        Destroy(ad.gameObject);
                    }
                }

                return;
            }


                        #if ENABLE_ADMOB
            AddAdmob();
            banner = GetComponent <AAAdmob>();
                        #endif

                        #if UNITY_ADS
            AddUnityAds();
                        #endif

                        #if ENABLE_ADCOLONY
            AddADColony();
                        #endif

                        #if CHARTBOOST
            AddChartboost();
                        #endif

            if (interstitialNetworks != null)
            {
                if (listInterstitials == null)
                {
                    listInterstitials = new List <IInterstitial>();
                }

                foreach (var m in interstitialNetworks)
                {
                                        #if ENABLE_ADMOB
                    if (m == InterstitialNetwork.Admob)
                    {
                        if (!listInterstitials.Contains(GetComponent <AAAdmob>()))
                        {
                            listInterstitials.Add(GetComponent <AAAdmob>());
                        }
                    }
                                        #endif

                                        #if CHARTBOOST
                    if (m == InterstitialNetwork.Chartboost)
                    {
                        if (!listInterstitials.Contains(GetComponent <AAChartboost>()))
                        {
                            listInterstitials.Add(GetComponent <AAChartboost>());
                        }
                    }
                                        #endif
                }
            }


            if (videoNetworks != null)
            {
                if (listVideos == null)
                {
                    listVideos = new List <IVideoAds>();
                }

                foreach (var m in videoNetworks)
                {
                                        #if ENABLE_ADCOLONY
                    if (m == VideoNetwork.ADColony)
                    {
                        if (!listVideos.Contains(GetComponent <AAADColony>()))
                        {
                            listVideos.Add(GetComponent <AAADColony>());
                        }
                    }
                                        #endif

                                        #if UNITY_ADS
                    if (m == VideoNetwork.UnityAds)
                    {
                        if (!listVideos.Contains(GetComponent <AAUnityAds>()))
                        {
                            listVideos.Add(GetComponent <AAUnityAds>());
                        }
                    }
                                        #endif
                }
            }

            if (rewardedVideoNetworks != null)
            {
                if (listRewardedVideos == null)
                {
                    listRewardedVideos = new List <IRewardedVideo>();
                }

                foreach (var m in rewardedVideoNetworks)
                {
                                        #if ENABLE_ADCOLONY
                    if (m == RewardedVideoNetwork.ADColony)
                    {
                        if (!listRewardedVideos.Contains(GetComponent <AAADColony>()))
                        {
                            listRewardedVideos.Add(GetComponent <AAADColony>());
                        }
                    }
                                        #endif

                                        #if UNITY_ADS
                    if (m == RewardedVideoNetwork.UnityAds)
                    {
                        if (!listRewardedVideos.Contains(GetComponent <AAUnityAds>()))
                        {
                            listRewardedVideos.Add(GetComponent <AAUnityAds>());
                        }
                    }
                                        #endif

                                        #if CHARTBOOST
                    if (m == RewardedVideoNetwork.Chartboost)
                    {
                        if (!listRewardedVideos.Contains(GetComponent <AAChartboost>()))
                        {
                            listRewardedVideos.Add(GetComponent <AAChartboost>());
                        }
                    }
                                        #endif
                }
            }


            DontDestroyOnLoad(gameObject);
        }
Exemplo n.º 14
0
 public void SetupBanner(IBanner banner)
 {
     m_Banner            = banner;
     m_BannerPlaceholder = CreateBannerPlaceholder();
 }
Exemplo n.º 15
0
 public static IHtmlString GetSubHeading(IBanner that) => that.Value <IHtmlString>("subHeading");
Exemplo n.º 16
0
 public void SetupBanner(IBanner banner)
 {
 }
Exemplo n.º 17
0
 public BannerController(IBanner dal)
 {
     this.dal = dal;
 }
Exemplo n.º 18
0
 public static IHtmlString GetBannerDescription(IBanner that) => that.Value <IHtmlString>("bannerDescription");
Exemplo n.º 19
0
 /// <summary>Static getter for Banner Image</summary>
 public static IPublishedContent GetBannerImage(IBanner that)
 {
     return(that.GetPropertyValue <IPublishedContent>("bannerImage"));
 }
Exemplo n.º 20
0
 public ManageBannersController()
 {
     _Banner = new Banner();
 }
Exemplo n.º 21
0
 /// <summary>Static getter for Large Title</summary>
 public static string GetLargeTitle(IBanner that)
 {
     return(that.GetPropertyValue <string>("largeTitle"));
 }
Exemplo n.º 22
0
 public static IPublishedContent GetMainImage(IBanner that) => that.Value <IPublishedContent>("mainImage");
Exemplo n.º 23
0
 /// <summary>Static getter for Small Heading</summary>
 public static string GetSmallheading(IBanner that)
 {
     return(that.GetPropertyValue <string>("smallheading"));
 }
Exemplo n.º 24
0
 public OldBanner(string str)
 {
     banner = new NewBanner(str);
 }
Exemplo n.º 25
0
 public static IPublishedContent GetBannerImage(IBanner that) => that.Value <IPublishedContent>("bannerImage");
 public BannerFlowController(IBanner <BannerModel> BannerService)
 {
     _banner = BannerService;
 }
Exemplo n.º 27
0
 public static string GetBannerHeading(IBanner that) => that.Value <string>("bannerHeading");
Exemplo n.º 28
0
 public static IEnumerable <Umbraco.Web.Models.Link> GetCTA(IBanner that) => that.Value <IEnumerable <Umbraco.Web.Models.Link> >("cTA");