Created
June 10, 2011 02:27
-
-
Save dkarzon/1018135 to your computer and use it in GitHub Desktop.
Testing Some AppEvents Rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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