Beispiel #1
0
    public override void InitWithConfig(Hashtable data)
    {
        base.InitWithConfig(data);
        if (data == null)
        {
            return;
        }
        data = (Hashtable)data ["PaidAlert"];
        if (data == null)
        {
            return;
        }

        bool      enable    = (bool)data["Enable"];
        Hashtable languages = (Hashtable)data["Languages"];
        int       second    = TypeConvert.ToInt(data["Second"]);
        string    url       = HDUtils.ParseString(data["URL"]);

        if (url == string.Empty)
        {
            return;
        }

        InhouseSDK.Languages outLang = new InhouseSDK.Languages();
        foreach (DictionaryEntry entry in languages)
        {
            InhouseSDK.Language lang    = new InhouseSDK.Language();
            Hashtable           content = (Hashtable)entry.Value;
            lang.Cancel  = HDUtils.ParseString(content ["Cancel"]);
            lang.Key     = HDUtils.ParseString(entry.Key);
            lang.Message = HDUtils.ParseString(content ["Message"]);
            lang.OK      = HDUtils.ParseString(content ["OK"]);
            lang.Title   = HDUtils.ParseString(content ["Title"]);
            outLang.addLanguage(lang);
        }

        _config.PaidAlert.Enable    = enable;
        _config.PaidAlert.Languages = outLang;
        _config.PaidAlert.Second    = second;
        _config.PaidAlert.URL       = url;

        HDDebug.Log("PaidAlertMgr: initWithConfig success");
        _didInit = true;
    }
Beispiel #2
0
    public override void InitWithConfig(Hashtable data)
    {
        base.InitWithConfig(data);
        if (data == null)
        {
            return;
        }
        data = (Hashtable)data["RateAlert"];
        if (data == null)
        {
            return;
        }

        Hashtable languages  = (Hashtable)data["Languages"];
        int       numDisplay = TypeConvert.ToInt(data["NumberToDisplayRatingPopup"]);
        string    url        = HDUtils.ParseString(data["URL"]);

        if (url == string.Empty)
        {
            return;
        }

        InhouseSDK.Languages outLang = new InhouseSDK.Languages();
        foreach (DictionaryEntry entry in languages)
        {
            InhouseSDK.Language lang    = new InhouseSDK.Language();
            Hashtable           content = (Hashtable)entry.Value;
            lang.Cancel  = HDUtils.ParseString(content ["Cancel"]);
            lang.Key     = HDUtils.ParseString(entry.Key);
            lang.Message = HDUtils.ParseString(content ["Message"]);
            lang.OK      = HDUtils.ParseString(content ["OK"]);
            lang.Title   = HDUtils.ParseString(content ["Title"]);
            outLang.addLanguage(lang);
        }

        _config.RateAlert.Languages = outLang;
        _config.RateAlert.NumberToDisplayRatingPopup = numDisplay;
        _config.RateAlert.URL = url;
        Debug.Log("Init rate ok");
        _didInit = true;
    }
Beispiel #3
0
    public override void InitWithConfig(Hashtable data)
    {
        base.InitWithConfig(data);
        if (data == null)
        {
            return;
        }
        data = (Hashtable)data["RemoveAds"];
        if (data == null)
        {
            return;
        }

        Hashtable languages = (Hashtable)data["Languages"];
        string    productId = HDUtils.ParseString(data["ProductID"]);
        string    price     = HDUtils.ParseString(data["Price"]);

        if (productId == string.Empty)
        {
            return;
        }

        InhouseSDK.Languages outLang = new InhouseSDK.Languages();
        foreach (DictionaryEntry entry in languages)
        {
            InhouseSDK.Language lang    = new InhouseSDK.Language();
            Hashtable           content = (Hashtable)entry.Value;
            lang.Cancel  = HDUtils.ParseString(content ["Cancel"]);
            lang.Key     = HDUtils.ParseString(entry.Key);
            lang.Message = HDUtils.ParseString(content ["Message"]);
            lang.OK      = HDUtils.ParseString(content ["OK"]);
            lang.Title   = HDUtils.ParseString(content ["Title"]);
            outLang.addLanguage(lang);
        }

        _config.RemoveAds.Languages = outLang;
        _config.RemoveAds.ProductID = productId;
        _config.RemoveAds.Price     = price;

        _didInit = true;
    }