Ejemplo n.º 1
0
 public static string GetName(this AdNetwork network)
 {
     if (network == Dependency.adBase)
     {
         return(Dependency.adBaseName);
     }
     return(network.ToString());
 }
Ejemplo n.º 2
0
    public Dictionary <string, string> asDictionary()
    {
        Dictionary <string, string> dictionary = new Dictionary <string, string>();

        dictionary.Add("Placement", placement.ToString());
        dictionary.Add("Network", network.ToString());
        dictionary.Add("Result", result.ToString());
        if (zone != null)
        {
            dictionary.Add("Zone", zone);
        }
        if (floorValue > 0)
        {
            dictionary.Add("Floor", floorValue.ToString());
        }
        return(dictionary);
    }
Ejemplo n.º 3
0
    public static List <ZoneAndFloor> parseAdNetworkFloors(AdNetwork network)
    {
        IEnumerable <string[]> source = TSVParser.Parse(PersistentSingleton <StringCache> .Instance.Get("Ads/network_floors"));

        string[] array  = source.First();
        int      column = Array.IndexOf(array, network.ToString());

        if (column < 0)
        {
            return(new List <ZoneAndFloor>());
        }
        return((from r in source.Skip(1)
                where r.nonEmpty(column)
                select r into line
                select new ZoneAndFloor
        {
            Zone = line.asString(0, line.toError <string>()),
            Floor = line.asInt(column, line.toError <int>())
        }).ToList());
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Grabs the ready to work (done initialization, setup, etc.)
        /// ad client for the specified network.
        /// </summary>
        /// <returns>The workable ad client.</returns>
        /// <param name="network">Network.</param>
        private static AdClientImpl GetWorkableAdClient(AdNetwork network)
        {
            switch (network)
            {
            case AdNetwork.AdColony:
                return(AdColonyClient);

            case AdNetwork.AdMob:
                return(AdMobClient);

            case AdNetwork.AudienceNetwork:
                return(AudienceNetworkClient);

            case AdNetwork.Heyzap:
                return(HeyzapClient);

            case AdNetwork.MoPub:
                return(MoPubClient);

            case AdNetwork.IronSource:
                return(IronSourceClient);

            case AdNetwork.UnityAds:
                return(UnityAdsClient);

            case AdNetwork.TapJoy:
                return(TapjoyClient);

            case AdNetwork.None:
                return(NoOpClientImpl.CreateClient());

            default:
                throw new NotImplementedException("No client found for the network:" + network.ToString());
            }
        }
Ejemplo n.º 5
0
        // Selects one of the created ad client corresponding to the specified network.
        private static IAdClient SelectAdClient(AdNetwork network)
        {
            switch (network)
            {
            case AdNetwork.AdColony:
                return(AdColonyClient);

            case AdNetwork.AdMob:
                return(AdMobClient);

            case AdNetwork.Chartboost:
                return(ChartboostClient);

            case AdNetwork.Heyzap:
                return(HeyzapClient);

            case AdNetwork.UnityAds:
                return(UnityAdsClient);

            case AdNetwork.None:
                return(NoOpClientImpl.CreateClient());

            default:
                throw new NotImplementedException("No client found for the network:" + network.ToString());
            }
        }
Ejemplo n.º 6
0
        // Gets the singleton client for the specified network.
        private static IAdClient CreateAdClient(AdNetwork network)
        {
            var settings = EM_Settings.Advertising;

            switch (network)
            {
            case AdNetwork.AdColony:
                return(AdColonyClientImpl.CreateClient(settings));

            case AdNetwork.AdMob:
                return(AdMobClientImpl.CreateClient(settings));

            case AdNetwork.Chartboost:
                return(ChartboostClientImpl.CreateClient(settings));

            case AdNetwork.Heyzap:
                return(HeyzapClientImpl.CreateClient(settings));

            case AdNetwork.UnityAds:
                return(UnityAdsClientImpl.CreateClient(settings));

            case AdNetwork.None:
                return(NoOpClientImpl.CreateClient());

            default:
                throw new NotImplementedException("No client implemented for the network:" + network.ToString());
            }
        }