Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Store the times in your application storage.</p> <p><a href="http://www.jeffblankenburg.com/2010/10/15/31-days-of-windows-phone-day-15-isolated-storage/" rel="nofollow">http://www.jeffblankenburg.com/2010/10/15/31-days-of-windows-phone-day-15-isolated-storage/</a></p> <p><strong>Update:</strong> This will make it 4 U: </p> <pre class="lang-cs prettyprint-override"><code>private void Application_Launching(object sender, LaunchingEventArgs e) { EnsureCheckThreeDaysInARow(); } private void Application_Activated(object sender, ActivatedEventArgs e) { EnsureCheckThreeDaysInARow(); } public bool EnsureCheckThreeDays() { IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("threeMagicalDay")) { var data = new List&lt;DateTime&gt;(); if (data.Count() &gt;= 3 &amp;&amp; !data.Any(a =&gt; a.Date == DateTime.Now.Date)) data.Remove(data.Min()); data.Add(DateTime.Now); var someTransform = data.OrderByDescending(a =&gt; a).Select(b =&gt; new Tuple&lt;int,int,int&gt;(b.Year,b.Month, b.Day)).Aggregate((c,d) =&gt; new Tuple&lt;int,int,int&gt;(c.Item1 - d.Item1, c.Item2 - d.Item2, c.Item3 - d.Item3)); if (someTransform.Item1 == -DateTime.Now.Date.Year &amp;&amp; someTransform.Item2 == -DateTime.Now.Date.Month &amp;&amp; someTransform.Item3 == 0) { //There you go... } else { //Handle it... } settings["threeMagicalDay"] = data; } else settings.Add("threeMagicalDay", new List&lt;DateTime&gt;(){DateTime.Now}); return false; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload