Exemple #1
0
 protected SwrveBaseCampaign(DateTime initialisedTime)
 {
     this.State = new SwrveCampaignState();
     this.swrveInitialisedTime    = initialisedTime;
     this.triggers                = new List <SwrveTrigger> ();
     this.minDelayBetweenMessage  = DefaultMinDelay;
     this.showMessagesAfterLaunch = swrveInitialisedTime + TimeSpan.FromSeconds(DefaultDelayFirstMessage);
 }
 protected SwrveBaseCampaign(DateTime initialisedTime)
 {
     State = new SwrveCampaignState();
     swrveInitialisedTime    = initialisedTime;
     triggers                = new List <SwrveTrigger>();
     minDelayBetweenMessage  = 60;
     showMessagesAfterLaunch = swrveInitialisedTime + TimeSpan.FromSeconds(180.0);
 }
Exemple #3
0
        public SwrveCampaignState(int campaignId, Dictionary <string, object> savedStatesJson)
        {
            string key = "Next" + campaignId;

            if (savedStatesJson.ContainsKey(key))
            {
                this.Next = MiniJsonHelper.GetInt(savedStatesJson, key);
            }
            key = "Impressions" + campaignId;
            if (savedStatesJson.ContainsKey(key))
            {
                this.Impressions = MiniJsonHelper.GetInt(savedStatesJson, key);
            }
            key = "Status" + campaignId;
            if (savedStatesJson.ContainsKey(key))
            {
                this.CurStatus = SwrveCampaignState.ParseStatus(MiniJsonHelper.GetString(savedStatesJson, key));
            }
            else
            {
                this.CurStatus = SwrveCampaignState.Status.Unseen;
            }
        }