Skip to content

Instantly share code, notes, and snippets.

@dkarzon
Created June 10, 2011 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dkarzon/1018135 to your computer and use it in GitHub Desktop.
Save dkarzon/1018135 to your computer and use it in GitHub Desktop.
Testing Some AppEvents Rules
//Create a rule called "adsandrate"
//Run Do action when "appstart" is run more than 3 times
// and first run is over 5 days ago
//Run AskToRate() and ActivateAds() on rule fire
EventClient.New()
.Add(Rule.When("adsandrate",
el => el.Any(e => e.Name == "appstart"
&& e.Occurrrences.Count > 3
&& e.Occurrrences.Min() < DateTime.Now.AddDays(-5)))
.Do(r =>
{
AskToRate();
ActivateAds();
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment